On 24.01.2007 07:20, Michael Glavassevich wrote:
This is not a bug. The annotation is on a particle [1][2] not an element declaration so you're looking for it in the wrong place. You need to dig into the enclosing complex type definition to find it.
Thanks for the quick reply. I actually saw the XSParticle class and went looking in that direction, but was unable to figure out how to *reliably* get to it from inside the startElement() event for <child>.
The problem is, the program needs to work with a variety of XSDs not known in advance, therefore no schema-specific knowledge must be encoded in it. So, the program cannot "know" that it can get to the XSParticle for the <child> reference by traversing the XSComplexTypeDefinition for <top>, and following all and sundry pointers through XSParticle.getTerm(), casting as appropriate and then recursively through sub-XSParticles, until it finds the one for <child>.
During experimentation I was able to do this with a hand crafted traversal code that would work from the startElement() event for <top> and only for this particular XSD, but as mentioned above this is not an option.
What I basically need, in addition to PSVIProvider.getElementDeclaration(), is a magic method getTheParticleThatTriggeredValidation(), that I can use from the startElement() event for <child>, and that would lead me to the XSParticle for the element reference.
Is there a way to accomplish something like this? A rough code snippet demonstrating how to get to the XSParticle for the element reference from the startElement() event for <child>, in a way that is not specific to this sample schema, would be much appreciated.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]