Java and parsing xsd to build a user interface

T

TIANA

Hi guys,
unfortunately i'm a newbee to java and xml and xsd...
part of my xsd looks like this:
<xs:simpleType name="val">
<xs:restriction base="xs:string">
<xs:enumeration value="aa"></xs:enumeration>
<xs:enumeration value="bb"></xs:enumeration>
<xs:enumeration 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
 
T

Tjerk Wolterink

TIANA said:
Hi guys,
unfortunately i'm a newbee to java and xml and xsd...
part of my xsd looks like this:
<xs:simpleType name="val">
<xs:restriction base="xs:string">
<xs:enumeration value="aa"></xs:enumeration>
<xs:enumeration value="bb"></xs:enumeration>
<xs:enumeration 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


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top