Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Type derivation results in duplicate particles
Type derivation results in duplicate particles [message #595041] Tue, 26 April 2005 21:13
Eclipse UserFriend
Originally posted by: anand.mindreef.com

Hi,
I'm experiencing some odd behavior with derived types.

I have a derivation chain with three types; say C derives from B and B
derives from A (all by extension).

*If* A is in one namespace and B&C are in a second ns, then I find the
XSDParticle representing B's content (obtained by
xsdComplexType.getContentType()) is duplicated in type C. This does
*not* occur when all three are in the same namespace.

More concretely, here is what the object hierarchy looks like from my
watch window for the the complexType "StrangeType" in the schema
fragment below.
Notice the XSDParticleImpl middleTypeParticle appears twice (the same
reference in mem).

Is this actually the correct behavior, or could I be using the library
incorrectly?
The only thing out of the ordinary about my usage (I think) is that I
have custom hooks into the parser for resolving schema fragments
embedded in other files.

Thanks,
Anand Thakker
Mindreef, Inc.


XSD Object Model:
-----------------

XSDComplexTypeDefinition
{
name="StrangeType"
content = XSDModelGroupImpl
{
compositor=sequence
particles[2] =
[ 0: XSDParticleImpl
{
term = XSDModelGroupImpl
{
compositor=sequence
particles[2] = [ 0: baseTypeParticle, 1: middleTypeParticle ]
}
}
1: XSDParticleImpl
{
term = XSDModelGroupImpl
{
compositor=sequence
particles[1] = [ 0: middleTypeParticle ]
}
}
]
}
}


Schemas:
--------


<!-- Schema One -->
<xs:schema elementFormDefault="qualified" targetNamespace="http://one/"
xmlns:this="http://one/"
xmlns:two="http://foo/bar/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:complexType name="StrangeType">
<xs:complexContent>
<xs:extension base="this:MiddleType">
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="MiddleType">
<xs:complexContent>
<xs:extension base="two:BaseType">
<xs:sequence>
<xs:element name="DuplicatedElement" type="xs:string"
minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>



<!-- Schema Two -->
<xs:schema elementFormDefault="qualified"
targetNamespace="http://foo/bar/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" >

<xs:complexType name="BaseType">
<xs:sequence>
<xs:element minOccurs="0" name="id" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:schema>
Previous Topic:getContent
Next Topic:Type derivation results in duplicate particles
Goto Forum:
  


Current Time: Sat Apr 20 14:32:55 GMT 2024

Powered by FUDForum. Page generated in 0.02831 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top