472,378 Members | 1,299 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 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 9542
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.