Uploaded image for project: 'XmlSchema'
  1. XmlSchema
  2. XMLSCHEMA-10

Serialized xs:restriction puts xs:attribute before xs:simpleType when it should not

    XMLWordPrintableJSON

    Details

      Description

      GIven this original markup:

      <xs:restriction base="xs:anyType">
      <xs:sequence>
      <xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="lang" use="optional"/>
      </xs:restriction>

      After parsing and serializing the schema with no intervening modification, the serialized result is:

      <xs:restriction base="tns:SimpleLiteral">
      <xs:attribute name="lang" use="prohibited"/>
      <xs:simpleType>
      <xs:restriction base="xs:string"/>
      </xs:simpleType>
      </xs:restriction>

      Note the xs:attribute before the xs:simpleType.

      The bug appears to a simple coding error in org.apache.ws.commons.schema.XmlSchemaSerializer.serializeSimpleContentRestriction(Document, XmlSchemaSimpleContentRestriction, XmlSchema) in that it's putting the attributes out before the inline simple type.

      I can provide a simple unit test that demonstrates the failure if needed.

        Attachments

        1. XMLSCHEMA-10-wek-patch.txt
          2 kB
          William Eliot Kimber
        2. wek-XMLSCHEMA-10-2.0.txt
          2 kB
          William Eliot Kimber

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              drmacro William Eliot Kimber
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: