Uploaded image for project: 'Commons Jelly'
  1. Commons Jelly
  2. JELLY-213

Generating xml nodes with attributes in diferente namespaces (for schemas..)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      I tried to find some info googling around and in the faq and couldn't find
      the answer, so here it goes.

      I need to generate the following xml (it's a sample off course), to support
      schemas.
      ------------------------------------------------
      <NodeName
      xmlns="http://blah/bleh"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema"
      xsi:schemaLocation="http://blah/blehSchemaLocation">
      <!-- Other content here -->
      </NodeName>
      ------------------------------------------------

      After several tries and some inconsistent behaviour, I thought the following
      jelly excerpt should be close to the solution, however "xml:attribute"
      doesn't support namespaces values.

      ------------------------------------------------
      <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
      <x:element URI="${myns}" name="NodeName">
      <x:attribute
      name="xsi:schemaLocation"
      URI="${myxsins}"
      trim="true">
      ${myschemaloc}
      </x:attribute>
      <!-- Other content here -->
      <x:element>
      </j:jelly>

      Where
      "myns" is for example http://blah/bleh
      "myschemaloc" is for example http://blah/blehSchemaLocation
      "myxsins" is for example http://www.w3.org/2001/XMLSchema
      ------------------------------------------------

      Is there any known solution for this problem? Even if working only for
      schemas?

      Attachments

        1. jelly-xml-updated.patch
          15 kB
          Diogo Bacelar Quintela
        2. jelly-xml.patch
          4 kB
          Diogo Bacelar Quintela
        3. jelly-patch4.patch
          34 kB
          Diogo Bacelar Quintela
        4. jelly-patch3.patch
          33 kB
          Diogo Bacelar Quintela

        Activity

          People

            Unassigned Unassigned
            dquintela Diogo Bacelar Quintela
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: