Eric Lilja wrote:
Hello, my first time posting on this list. I've taken over some code that was written several years ago and I'm supposed to update it. One of the things the code does is parse an xml schema. I encountered a problem when I upgraded xerces to 2.9.1: The method XSElementDeclaration.getAnnotationAttrs() is no longer available. I googled for getAnnotationAttrs to see if I could find information on what I should use instead but google returned zero hits, heh.

Hmm, I checked which version of xerces-j the old code base ships with and it was 2.3.0. Then I discovered that if I replace the .jar-file that ships with code base with the official one the code no longer compiles due to getAnnotationAttrs() being missing. So no wonder there were no hits on google, this is a modified version...so I guess my question is more general then: How do I get the annotations in the example schema below for my elements?


Let me clarify with an example schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:foo="http://www.foobar.com/foo";>
    <xs:element name="movies">
        <xs:complexType>
            <xs:sequence>
<xs:element name="movie" type="xs:string" foo:bar="somevalue"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

In the old code base with the ancient xerces, I have a class representing simple elements. That class is constructed using an XSParticle and a path, and through that particle I could call getTerm() and cast the return value to XSElementDeclaration and then call getAnnotationAttrs which returns a List. For the simple element movive that list would contain three strings:
"http://www.foobar.com/foo";
"bar"
"somevalue"

My question is, using xerces 2.9.1: How can I replace the call to the now missing method XSElementDeclaration.getAnnotationAttrs() in order to get the annotations (if that's the proper word) where they appear in the schema? I noticed the method getAnnotations() which I tried calling in a number of places but it always returns an XSObjectList with 0 items...

Sorry for not posting a complete program, I felt it would be too long.

- Eric

PS. I'm a beginner using xerces. DS.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to