You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by "Saha, Sanjeev" <SS...@asce.org> on 2004/05/05 14:56:27 UTC

Replacing default element values... quickly!

Consider this.. the schema is the sample easypo.xsd, with a slight
change, the customer name is now nillable="false" and default="John
Doe".

For the xml, take the easypo1.xml sample and nullify the customer name
element.

The intent is to pass it through a handler, in this case the sample
docs.xmlbeans.POHandler class and reproduce the incoming xml, this time
with the customer name replaced with "John Doe" instead of being null.

If I access the customer name as customer.getName() and then do a
poDoc.xmlText() the name seems to be populated. However the same doesn't
happen if I do poDoc.Factory.parse(xmlfile) and then in the next step
call poDoc.xmlText() :o(

The idea is that if the incoming xml doesn't provide values for, say
'n', no.of fields that can have default values, then after the parse the
outgoing xml should make them available.

Is there an easy way out that I am missing?

-Sanjeev


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/