You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Leif Singer <ax...@singer.sh> on 2007/10/31 11:57:40 UTC
XmlSchema.write returning empty
Hello,
I know this question is probably supposed to go to an XmlSchema-users
or at least Commons-users mailing list, but since on http://ws.apache.org/commons/XmlSchema/mail-lists.html
I didn't find any of these, I post it here.
I'm trying to generate XML Schema using the XMLSchema API. I setup my
namespaces, add types and elements. When I'm done,
XmlSchema.getSchemaTypes() returns everything I added. However, when I
try to serialize the object model, I only get a <schema /> object with
my namespace declarations, but not containing any types / elements.
E.g., for a ComplexType, I create an XmlSchemaComplexType, set its
name, set its particle to be an XmlSchemaSequence and then use
XmlSchema.addType(XmlSchema type) to add it to my schema's types. I
added elements to the XmlSchemaSequence using
XmlSchemaSequence.getItems().add(XmlSchemaObject) with each element
being an instance of XmlSchemaElement.
I remember a similar quirk when using WSDL4J to generate WSDL. On some
objects I needed to call setUndefined(false). Maybe there is something
simple I need to call before writing it all out? Or maybe I'm doing
something fundamentally wrong?
Thanks in advance
Leif Singer
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org