Reputation: 1
Is is possible to return all elements of an XMLBeans XMLObject even if they were not set? I have a XmlObject that I generated from an XSD and when I convert the XmlObject to a String I would like to return ALL fields, not just the few that I've set. I tried the following command:
xmlObject.toString();
xmlObject.xmlText();
xmlObject.save(stringWriter); // Then converted the StringWriter to a String
All of the above commands only return the fields I have actually set a value for. If there isn't a command to do this is there an attribute that I can add to the XSD to make the field required? I already have minOccurs="1"
.
Upvotes: 0
Views: 1900
Reputation: 487
I guess, you'd have to specify default values for all (mandatory) properties in your schema definition in order to have them implicitly set in the string output of the XmlObject.
Upvotes: 1