Home » Archived » XML Schema Definition (XSD) » traversing hierarchy of particles
traversing hierarchy of particles [message #41379] |
Wed, 14 April 2004 13:04 |
Eclipse User |
|
|
|
Originally posted by: hoe.zurich.ibm.com
Is there a way to obtain the "transitive closure" around XSDParticles
that extend/restrict each other? What I have in mind is asking e.g. a
group particle for all its sub-particles (local and "inherited" ones)
all at once.
Thanks,
Christian
|
|
|
Re: traversing hierarchy of particles [message #41410 is a reply to message #41379] |
Wed, 14 April 2004 15:09 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Christian,
Particles don't extend or restrict each other, so I'm a little confused.
XSDModelGroup.getParticles() will give you all the "sub-particles"
regardless of where they come from. Are you looking for something in
addition to this?
Christian Hoertnagl wrote:
> Is there a way to obtain the "transitive closure" around XSDParticles
> that extend/restrict each other? What I have in mind is asking e.g. a
> group particle for all its sub-particles (local and "inherited" ones)
> all at once.
>
> Thanks,
> Christian
|
|
|
Re: traversing hierarchy of particles [message #41439 is a reply to message #41410] |
Wed, 14 April 2004 16:05 |
Eclipse User |
|
|
|
Originally posted by: hoe.zurich.ibm.com
Ed Merks wrote:
> Particles don't extend or restrict each other, so I'm a little confused.
Sorry for being unclear. I was refering to (complex) types that
extend/restrict each other, and that use those particles indirectly.
> XSDModelGroup.getParticles() will give you all the "sub-particles"
> regardless of where they come from. Are you looking for something in
> addition to this?
Thx, this may already be enough. What I have in mind is a situation
where a complex type references an XSDModelGroup (via XSDParticle with
XSDContentTypeCategory.ELEMENT_ONLY_LITERAL, say). If the base type also
has its XSDModelGroup, the two XSDCompositor's may be different, as far
as the XSD data structures are concerned: one CHOICE_LITERAL, the other
ALL_LITERAL, I guess. Is this sort of thing detected/resolved, when I
call XSDModelGroup.getParticles() to get a "flat" list including
"sub-particles", or do I have to do sg. special myself (XML Schema Part
1, section 3.9.6 says more on cases that may occur).
Hope it's a bit clearer now & I'll do some more tests locally,
Christian
|
|
|
Re: traversing hierarchy of particles [message #41468 is a reply to message #41439] |
Wed, 14 April 2004 16:42 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Christian,
The particle structure resolves all the references so that you can walk the
"virtual" particle tree exactly as it is defined in the schema spec. Just make
sure you call the methods that say they represent an "infoset property" rather
than the ones that are "concrete", i.e., XSDModelGroup.getParticles() verses
XSDModelGroup.getContents().
Christian Hoertnagl wrote:
> Ed Merks wrote:
>
> > Particles don't extend or restrict each other, so I'm a little confused.
>
> Sorry for being unclear. I was refering to (complex) types that
> extend/restrict each other, and that use those particles indirectly.
>
> > XSDModelGroup.getParticles() will give you all the "sub-particles"
> > regardless of where they come from. Are you looking for something in
> > addition to this?
>
> Thx, this may already be enough. What I have in mind is a situation
> where a complex type references an XSDModelGroup (via XSDParticle with
> XSDContentTypeCategory.ELEMENT_ONLY_LITERAL, say). If the base type also
> has its XSDModelGroup, the two XSDCompositor's may be different, as far
> as the XSD data structures are concerned: one CHOICE_LITERAL, the other
> ALL_LITERAL, I guess. Is this sort of thing detected/resolved, when I
> call XSDModelGroup.getParticles() to get a "flat" list including
> "sub-particles", or do I have to do sg. special myself (XML Schema Part
> 1, section 3.9.6 says more on cases that may occur).
>
> Hope it's a bit clearer now & I'll do some more tests locally,
> Christian
|
|
|
Re: traversing hierarchy of particles [message #585586 is a reply to message #41379] |
Wed, 14 April 2004 15:09 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Christian,
Particles don't extend or restrict each other, so I'm a little confused.
XSDModelGroup.getParticles() will give you all the "sub-particles"
regardless of where they come from. Are you looking for something in
addition to this?
Christian Hoertnagl wrote:
> Is there a way to obtain the "transitive closure" around XSDParticles
> that extend/restrict each other? What I have in mind is asking e.g. a
> group particle for all its sub-particles (local and "inherited" ones)
> all at once.
>
> Thanks,
> Christian
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: traversing hierarchy of particles [message #585608 is a reply to message #41410] |
Wed, 14 April 2004 16:05 |
Eclipse User |
|
|
|
Originally posted by: hoe.zurich.ibm.com
Ed Merks wrote:
> Particles don't extend or restrict each other, so I'm a little confused.
Sorry for being unclear. I was refering to (complex) types that
extend/restrict each other, and that use those particles indirectly.
> XSDModelGroup.getParticles() will give you all the "sub-particles"
> regardless of where they come from. Are you looking for something in
> addition to this?
Thx, this may already be enough. What I have in mind is a situation
where a complex type references an XSDModelGroup (via XSDParticle with
XSDContentTypeCategory.ELEMENT_ONLY_LITERAL, say). If the base type also
has its XSDModelGroup, the two XSDCompositor's may be different, as far
as the XSD data structures are concerned: one CHOICE_LITERAL, the other
ALL_LITERAL, I guess. Is this sort of thing detected/resolved, when I
call XSDModelGroup.getParticles() to get a "flat" list including
"sub-particles", or do I have to do sg. special myself (XML Schema Part
1, section 3.9.6 says more on cases that may occur).
Hope it's a bit clearer now & I'll do some more tests locally,
Christian
|
|
|
Re: traversing hierarchy of particles [message #585627 is a reply to message #41439] |
Wed, 14 April 2004 16:42 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Christian,
The particle structure resolves all the references so that you can walk the
"virtual" particle tree exactly as it is defined in the schema spec. Just make
sure you call the methods that say they represent an "infoset property" rather
than the ones that are "concrete", i.e., XSDModelGroup.getParticles() verses
XSDModelGroup.getContents().
Christian Hoertnagl wrote:
> Ed Merks wrote:
>
> > Particles don't extend or restrict each other, so I'm a little confused.
>
> Sorry for being unclear. I was refering to (complex) types that
> extend/restrict each other, and that use those particles indirectly.
>
> > XSDModelGroup.getParticles() will give you all the "sub-particles"
> > regardless of where they come from. Are you looking for something in
> > addition to this?
>
> Thx, this may already be enough. What I have in mind is a situation
> where a complex type references an XSDModelGroup (via XSDParticle with
> XSDContentTypeCategory.ELEMENT_ONLY_LITERAL, say). If the base type also
> has its XSDModelGroup, the two XSDCompositor's may be different, as far
> as the XSD data structures are concerned: one CHOICE_LITERAL, the other
> ALL_LITERAL, I guess. Is this sort of thing detected/resolved, when I
> call XSDModelGroup.getParticles() to get a "flat" list including
> "sub-particles", or do I have to do sg. special myself (XML Schema Part
> 1, section 3.9.6 says more on cases that may occur).
>
> Hope it's a bit clearer now & I'll do some more tests locally,
> Christian
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Fri Mar 29 12:21:11 GMT 2024
Powered by FUDForum. Page generated in 0.02779 seconds
|