|
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] 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: 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.
|

