users@jaxb.java.net

XPath and External Binding Declarations.

From: Terence Song <terence.song_at_bristol.ac.uk>
Date: Mon, 25 Apr 2005 17:57:21 +0100

Hi,

I have a problem with external binding declarations. I have 4 schema files:

A.xsd
B.xsd
C.xsd
ABC.xsd

ABC.xsd uses <xs:include>s to include A.xsd and B.xsd, and <xs:redefine>s
attributeGroups in C.xsd with attributeGroups in A.xsd and B.xsd.

<xs:include schemaLocation="A.xsd" />
<xs:include schemaLocation="B.xsd" />
<xs:redefine schemaLocation="C.xsd">
  <xs:attributeGroup name="C.attrib">
    <xs:attributeGroup ref="C.attrib"/>
    <xs:attributeGroup ref="A.attrib"/>
  </xs:attributeGroup>

  <xs:attributeGroup name="C.attrib">
    <xs:attributeGroup ref="C.attrib"/>
    <xs:attributeGroup ref="B.attrib"/>
  </xs:attributeGroup>

</xs:redefine>

Now, If I compile schema="ABC.xsd" (using the XJC Ant task) without any
customization, everything seems fine. However, I would like to make "class" and
"property" binding customizations to the schemas.

According to Kohsuke Kawaguchi in a reply to a question regarding
"Customization and XPath Expressions," XPath works on XML documents as infoset,
it doesn't understand the concept of <xs:include>s.