Java and parsing xsd to build a user interface

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TIANA

    Java and parsing xsd to build a user interface

    Hi guys,
    unfortunately i'm a newbee to java and xml and xsd...
    part of my xsd looks like this:
    <xs:simpleTyp e name="val">
    <xs:restricti on base="xs:string ">
    <xs:enumerati on value="aa"></xs:enumeration>
    <xs:enumerati on value="bb"></xs:enumeration>
    <xs:enumerati on value="cc"></xs:enumeration>
    </xs:restriction>
    </xs:simpleType>

    could anyone give me a hint, how to parse my xsd in java
    to fill a combobox out of the values in the enumeration tags?
    I guess I have to work around with jdom?!?
    I'm working with java 1.4.1..
    would be glad for any help or hint
    thanks in advance
    tiana
  • Tjerk Wolterink

    #2
    Re: Java and parsing xsd to build a user interface

    TIANA wrote:
    [color=blue]
    > Hi guys,
    > unfortunately i'm a newbee to java and xml and xsd...
    > part of my xsd looks like this:
    > <xs:simpleTyp e name="val">
    > <xs:restricti on base="xs:string ">
    > <xs:enumerati on value="aa"></xs:enumeration>
    > <xs:enumerati on value="bb"></xs:enumeration>
    > <xs:enumerati on value="cc"></xs:enumeration>
    > </xs:restriction>
    > </xs:simpleType>
    >
    > could anyone give me a hint, how to parse my xsd in java
    > to fill a combobox out of the values in the enumeration tags?
    > I guess I have to work around with jdom?!?
    > I'm working with java 1.4.1..
    > would be glad for any help or hint
    > thanks in advance
    > tiana[/color]


    Your right, you have to use some kind of xml reader, that can be a dom or sax,
    just use what you think is suitable for the situation.
    If you only have to read the values you can use SAX, but i find sax somewhat strange
    to use, jdom is more logical i think; only it consumes more memmory and is slower.

    If you dont know how to use JDom just read the api's.

    Comment

    Working...