Thanks Andrew,

 

Could you please provide me with an example code to parse and print out this simple schema using Castor?

 

Schema:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 

 

<xsd:element name="note" type="NoteType"/>

 

  <xsd:complexType name="NoteType">

     <xsd:sequence>

            <xsd:element name="to" type="xsd:string"/>

            <xsd:element name="from" type="xsd:string"/>

            <xsd:element name="heading" type="xsd:string"/>

            <xsd:element name="body" type="xsd:string"/>

    </xsd:sequence>

  </xsd:complexType>

</xsd:schema>

 

Print out:

Note

To

From

Heading

Body

 

Thank you very much,

Gabriel

 

 


From: Andrew Fawcett [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 17, 2005 5:18 AM
To: [email protected]
Subject: RE: [castor-user] help for Schema parser

 

Hi,

 

Part of the Castor supporting library is a SOM (Schema Object Model) in org.exolab.castor.xml.schema.

 

This library allows you to parse a xsd file and the programmatically enumerate its contents.

 

The org.exolab.castor.xml.schema.reader.SchemaUnmarshaller class is a SAX handler that will return a Schema object to you once you’ve fed it through a SAX parser.

 

Cheers,

 

Andy.

 

 


From: Enriquez, Gabriel [mailto:[EMAIL PROTECTED]
Sent: 16 August 2005 18:52
To: [email protected]
Subject: [castor-user] help for Schema parser

 

I want to parse a xsd file.

 

For example, “test.xsd” file:

 

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 

 

<xsd:element name="note" type="NoteType"/>

 

  <xsd:complexType name="NoteType">

     <xsd:sequence>

            <xsd:element name="to" type="xsd:string"/>

            <xsd:element name="from" type="xsd:string"/>

            <xsd:element name="heading" type="xsd:string"/>

            <xsd:element name="body" type="xsd:string"/>

    </xsd:sequence>

  </xsd:complexType>

</xsd:schema>

 

And I want to print important elements:

 

Like:

 

Note

To

From

Heading

Body

 

How can I do that? Could your provide me with an example?

 

Thanks in advance,

Gabriel

 

 

CODA has a new world-class consolidation package.
Find out more about www.coda.com/ocra

 



The information in this message is confidential and may be legally privileged. It may not be disclosed to, or used by, anyone other than the addressee. If you receive this message in error, please advise us immediately.

Internet emails are not necessarily secure. CODA does not accept responsibility for changes to any email which occur after the email has been sent. Attachments to this email may contain software viruses, which could damage your systems. CODA has checked the attachments for viruses before sending, but you should virus-check them before opening.

 

Reply via email to