473,387 Members | 1,481 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,387 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 17 '05 #1
5 9595
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 17 '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 17 '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 17 '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 17 '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 17 '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
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.