473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 9593
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Fu Bo Xia | last post by:
anyone know a Java (or Java usable) package that converts XML Schema (XSD) documents into a tree form? thanks, fu bo
7
by: Rolf Kemper | last post by:
Dear All, somehow I remember that such or similar question was discussed already somewhere. But I can't find it anymore. I have a template calling itself. As long it goes deeper into the...
1
by: Matthias H. Risse | last post by:
Hi! I am looking for projects dealing with the representation of XML as a collapsable tree. especialy loading of an XML stream, visual modification of the tree and later rendering of the...
7
by: Philipp H. Mohr | last post by:
Hello, I am trying to xor the byte representation of every char in a string with its predecessor. But I don't know how to convert a char into its byte representation. This is to calculate the...
25
by: prabhat143 | last post by:
Hi, Given a singly linked, null terminated list, how can it be converted to tree? Each node in the list has three attributes: it's ID, it's parent ID and of course, the next node it's pointing...
8
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does...
9
by: johan.tibell | last post by:
I'm in the process of writing an interpreter for lambda calculus (i.e. a small functional programming language) in C. I've previously written one in Haskell so I understand at least some of the...
7
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
3
by: Thorsten Kampe | last post by:
Hi, This is a fairly general question: is there some kind of module or framework that allows building a tree like structure from certain kind of data? To be specific: I have a program that...
11
by: Tim Arnold | last post by:
hi, I've got lots of xhtml pages that need to be fed to MS HTML Workshop to create CHM files. That application really hates xhtml, so I need to convert self-ending tags (e.g. <br />) to plain html...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.