Hi Roshan I tried your test case and you're right
ProductTypeDocument.type.getAnnotation(); does give you null, even in the most recent version of XmlBeans. As a solution to your immediate problem the slightly more complicated call: SchemaAnnotation ann = ((SchemaLocalElement) ProductTypeDocument.type.getContentModel()).getAnnotation(); does give you the annotation you want. But I have some sympathy with you - I would have expected the annotation there too. So, if you want, feel free to log an enhancement JIRA for us to review how we provide access to annotations. (Or if you feel up to it please look at the source code yourself and provide a patch for the committers to review). Cheers, Lawrence > -----Original Message----- > From: Roshan Punnoose [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 19, 2005 4:32 AM > To: [email protected] > Subject: Xsd Annotations > > Hi, > > I am trying to get the xsd annotations out of an xsd using xmlbeans. > > Here is my xsd snippet: > <xs:element name="product-type"> > <xs:annotation> > <xs:documentation> ProductTypes are cool</xs:documentation> > </xs:annotation> > <xs:complexType> > <xs:sequence> > <xs:element ref="inve:contributors"/> > </xs:sequence> > </xs:complexType> > </xs:element> > > > The code should be: > SchemaAnnotation annotation = ProductTypeDocument.type.getAnnotation(); > > But this is null. I'm using XmlBeans 1.04, is there something else I'm > supposed to do? > > Roshan Punnoose > Phone: 301-497-6039 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

