Hi list,
i have a question, that might be a stupid one, but i can not figure out,
if its even work with xerces-j or not.
I have a xsd and i want to build a map like
element -> (can have) element -> with attributes( foo, bar )
or element -> with
attributes(foo)
->
(can have) element
or element
or element
and so on. Maybe a hashtable with the keys [attributes] ans [elements]
for each element. That is not imortent, importnt is that i have to read
the schema and store the informations about elements, attributes and
types in a diffrent format inside the memory.
I tried to play around with the xs.QueryXs example, but i only get the
root element. I tried to read docu, goole, and so on, but i can't find
any example how to dump all elements in the order the xsd descripes.
For example, i have these code:
XSModel model = schemaLoader.loadURI(argv[0]);
XSNamedMap map = model.getComponents(XSConstants.ELEMENT_DECLARATION);
if (map.getLength() != 0) {
System.out.println("*************************************************");
System.out.println("* Global element declarations: {namespace} name ");
System.out.println("*************************************************");
for (int i = 0; i < map.getLength(); i++) {
XSObject item = map.item(i);
System.out.println("{" + item.getNamespace() + "}" +
item.getName());
}
}
witch shows me the right root element of a valid xml, descripes in the
xsd. But how to get the next level. How can i get all elements that are
allowd inside the root-element?
can someone post me a example or point me into the right direction, please.
best regards,
kris
---
wdv Gesellschaft fuer Medien & Kommunikation mbH & Co. OHG,
Bad Homburg v.d.H., AG. Bad Homburg HRA 3087
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]