Stanimir Stamenkov <[EMAIL PROTECTED]> wrote on 12/30/2006 03:15:01 PM:
> /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] This is controlled by the "http://apache.org/xml/features/generate-synthetic-annotations" [1] feature. You need to set it to true if you want such annotations to appear in the XSModel. > -- > Stanimir > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] [1] http://xerces.apache.org/xerces2-j/features.html#generate-synthetic-annotations Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]