jaxb
  1. jaxb
  2. JAXB-947

xjc: Incorrect propOrder if xs:all in an extension of an attribute-only type

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.6
    • Fix Version/s: None
    • Component/s: xjc
    • Labels:
      None

      Description

      I have the following schema:

      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
              targetNamespace="http://www.example.org/proporder"
              xmlns:proporder="http://www.example.org/proporder"
              elementFormDefault="qualified">
      
          <complexType name="parent">
              <attribute name="version" type="string"></attribute>
          </complexType>
      
          <complexType name="child">
              <complexContent>
                      <extension base="proporder:parent">
                              <all>
                                      <element name="foo" type="string"></element>
                                      <element name="bar" type="string"></element>
                              </all>
                      </extension>
              </complexContent>
          </complexType>
      
          <element name="childInstance" type="proporder:child"/>
      </schema>
      

      The generated source for the child element class ignores the all group model and sets propOrder=

      {"foo", "bar"}

      .
      The correct behavior would be propOrder={ }

      With the current behavior, the following xml will not validate, even if correct:

      <?xml version="1.0" encoding="UTF-8"?>
      <proporder:childInstance version="foobar" xmlns:proporder="http://www.example.org/proporder">
        <proporder:bar>bar</proporder:bar>
        <proporder:foo>foo</proporder:foo>
      </proporder:childInstance>
      

      Looking at the source, the reason is that the ALL-Check is only done in FreshComplexTypeBuilder.java, but not in ExtendedComplexTypeBuilder.java.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Iaroslav Savytskyi
            Reporter:
            georgm
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: