convert XSD to tree representation

Fu Bo Xia

Usenet Archive
Joined
Sep 8, 2003
Messages
2
Reaction score
0
anyone know a Java (or Java usable) package that converts XML Schema (XSD)
documents into a tree form?

thanks,
fu bo
 

Raymond DeCampo

Usenet Archive
Joined
Aug 1, 2003
Messages
502
Reaction score
0
Fu said:
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
 

Fu Bo Xia

Usenet Archive
Joined
Sep 8, 2003
Messages
2
Reaction score
0
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
 

Raymond DeCampo

Usenet Archive
Joined
Aug 1, 2003
Messages
502
Reaction score
0
Fu said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top