users@jaxb.java.net

Re: XPath and External Binding Declarations.

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 25 Apr 2005 10:09:30 -0700

Terence Song wrote:
> 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.

Did you hit enter too early?

Tell me which portion of the schema you want to apply the customization.
   You can always point to any portion of any of the schema documents
using XPath.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com