convert XSD to tree representation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fu Bo Xia

    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


  • Raymond DeCampo

    #2
    Re: convert XSD to tree representation

    Fu Bo Xia wrote:[color=blue]
    > anyone know a Java (or Java usable) package that converts XML Schema (XSD)
    > documents into a tree form?
    >
    >
    > thanks,
    > fu bo
    >
    >[/color]
    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

    Comment

    • Bob Foster

      #3
      Re: convert XSD to tree representation

      What sort of tree are you looking for?

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

      Bob Foster


      "Fu Bo Xia" <fubo.x@optusho me.com.au> wrote in message
      news:3f5c5c35$0 $14560$afc38c87 @news.optusnet. com.au...[color=blue]
      > anyone know a Java (or Java usable) package that converts XML Schema (XSD)
      > documents into a tree form?
      >
      >
      > thanks,
      > fu bo
      >
      >[/color]


      Comment

      • Gregory Vaughan

        #4
        Re: convert XSD to tree representation

        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" <fubo.x@optusho me.com.au> wrote in message
        news:3f5c5c35$0 $14560$afc38c87 @news.optusnet. com.au...[color=blue]
        > anyone know a Java (or Java usable) package that converts XML Schema (XSD)
        > documents into a tree form?
        >
        >
        > thanks,
        > fu bo
        >
        >[/color]


        Comment

        • Fu Bo Xia

          #5
          Re: convert XSD to tree representation

          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"
          elementFormDefa ult="qualified" >
          <xsd:element name="bookstore ">
          <xsd:complexTyp e>
          <xsd:squence>
          <xsd:element ref="novel"/>
          <xsd:element ref="journal"/>
          </xsd:squence>
          </xsd:complexType >
          </xsd:element>
          <xsd:element name="novel">
          <xsd:complexTyp e>
          <xsd:squence>
          <xsd:element ref="exemplar"/>
          </xsd:squence>
          </xsd:complexType >
          </xsd:element>
          <xsd:element name="journal">
          <xsd:complexTyp e>
          <xsd:squence>
          <xsd:element ref="exemplar"/>
          </xsd:squence>
          </xsd:complexType >
          </xsd:element>
          <xsd:element name="exemplar" >
          <xsd:complexTyp e>
          <xsd:squence>
          <xsd:element name="title" type="xsd:strin g"/>
          <xsd:element name="author" type="xsd:strin g"/>
          </xsd:squence>
          </xsd:complexType >
          </xsd:element>
          </xsd:schema>

          this will convert to a tree similar to the one pictured here:

          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



          Comment

          • Raymond DeCampo

            #6
            Re: convert XSD to tree representation

            Fu Bo Xia wrote:[color=blue]
            > 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:
            >[/color]

            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.
            [color=blue]
            >
            > 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.
            >[/color]

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

            Ray

            Comment

            Working...