/Igor Lobanov/:

The question is whether there is a way to retrieve such "annotations" from the schema object model in a standard or a Xerces-specific way? I havn't found any way to do it by studying XML Schema API offered by Xerces.

Unless I'm missing something you just access the annotations for a specific component - see the |getAnnotations| and |getAnnotation| methods of |XSElementDeclaration|, |XSAttributeDeclaration| etc. interfaces <http://xerces.apache.org/xerces2-j/javadocs/xs/>.

I'm attaching a simple example which works for me. I notice annotation is not created when just non-schema attributes are defined on a schema component element and no child <annotation> is present, e.g.:

  <xs:element name="foo" type="xs:string" foo:bar="baz" />

According to the release information page <http://xerces.apache.org/xerces2-j/releases.html> this should have been taken care of in Xerces-J 2.7.0:

* Added support for generating synthetic annotations when a schema component has non-schema attributes but no child annotation. [Ankit Pasricha]

--
Stanimir

Attachment: AnnotationTest.java
Description: java/

Attachment: sample_schema.xsd
Description: application/xml

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

Reply via email to