469,353 Members | 2,060 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

convert XSD to tree representation

anyone know a Java (or Java usable) package that converts XML Schema (XSD)
documents into a tree form?
thanks,
fu bo
Jul 20 '05 #1
5 9400
Fu Bo Xia wrote:
anyone know a Java (or Java usable) package that converts XML Schema (XSD)
documents into a tree form?
thanks,
fu bo

Fu Bo,

First, remember that XML Schema must also be valid XML files. So
really, if you find an XML tool that does what you want, you are golden.
Are you looking for (open) source code you can build on a tool?

JEdit has an XML plugin that will put the XML into a tree.
(http://www.jedit.org).

Ray

Jul 20 '05 #2
What sort of tree are you looking for?

If you just want an element tree, almost all XML editors will do that.

Bob Foster
http://www.xmlbuddy.com/

"Fu Bo Xia" <fu****@optushome.com.au> wrote in message
news:3f***********************@news.optusnet.com.a u...
anyone know a Java (or Java usable) package that converts XML Schema (XSD)
documents into a tree form?
thanks,
fu bo

Jul 20 '05 #3
We market a shareware product called DTDChart that displays a document
structure as a tree chart. You would have to convert the XSD into a DTD
first. Not sure if this is the kind of thing you are looking for.

More info at http://www.intsysr.com/dtdchart.htm

"Fu Bo Xia" <fu****@optushome.com.au> wrote in message
news:3f***********************@news.optusnet.com.a u...
anyone know a Java (or Java usable) package that converts XML Schema (XSD)
documents into a tree form?
thanks,
fu bo

Jul 20 '05 #4
sorry let me clearify my question,

i'm looking for a java API that will convert a XML Schema (XSD) document
from a textual representation to a tree representation that's stored in a
tree structured object. for example if i have the following XSD:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.books.org"
xmlns="http://www.books.org"
elementFormDefault="qualified">
<xsd:element name="bookstore">
<xsd:complexType>
<xsd:squence>
<xsd:element ref="novel"/>
<xsd:element ref="journal"/>
</xsd:squence>
</xsd:complexType>
</xsd:element>
<xsd:element name="novel">
<xsd:complexType>
<xsd:squence>
<xsd:element ref="exemplar"/>
</xsd:squence>
</xsd:complexType>
</xsd:element>
<xsd:element name="journal">
<xsd:complexType>
<xsd:squence>
<xsd:element ref="exemplar"/>
</xsd:squence>
</xsd:complexType>
</xsd:element>
<xsd:element name="exemplar">
<xsd:complexType>
<xsd:squence>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="author" type="xsd:string"/>
</xsd:squence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

this will convert to a tree similar to the one pictured here:
http://tinyurl.com/mt9t
of course there's no way to capture every detail of a XSD into a tree, but
that's not what i'm looking for.

alternatively, could you point to a some good Java XML parsing tutorials.
thanks,
fu bo

Jul 20 '05 #5
Fu Bo Xia wrote:
sorry let me clearify my question,

i'm looking for a java API that will convert a XML Schema (XSD) document
from a textual representation to a tree representation that's stored in a
tree structured object. for example if i have the following XSD:

Why don't you just parse it as XML using Xerces, for example? Then you
will have a standard DOM structure which is very tree-like.

this will convert to a tree similar to the one pictured here:
http://tinyurl.com/mt9t
of course there's no way to capture every detail of a XSD into a tree, but
that's not what i'm looking for.

alternatively, could you point to a some good Java XML parsing tutorials.


See the Xerces site on http://xml.apache.org.

Ray

Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Fu Bo Xia | last post: by
7 posts views Thread by Rolf Kemper | last post: by
1 post views Thread by Matthias H. Risse | last post: by
7 posts views Thread by Philipp H. Mohr | last post: by
25 posts views Thread by prabhat143 | last post: by
9 posts views Thread by johan.tibell | last post: by
7 posts views Thread by elliotng.ee | last post: by
3 posts views Thread by Thorsten Kampe | last post: by
11 posts views Thread by Tim Arnold | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.