[xml] How to get elements default values, defined in the schema



Hi,

I've used xmlSchema functions i.e. "xmlSchemaValidateDoc(...)" to validate a
xml document.
To read an element's content I have used "xmlNodeGetContent(...)" function.

The schema I use has defined default values for some of the elements i.e. 
"<xsd:element name="AcquirerName" type="xsd:string" default="WESTPAC"
minOccurs="0"/>"

I expected after validating a document against the schema, default values
get loaded into the document nodes
and xmlNodeGetContent to return default values if an element doesn't appear
in the xml document or appear with
an empty content.
However my assumptions don't seem to be correct. xmlNodeGetContent never
returns any values if element
appears with empty content i.e. "<AcquirerName></AcquirerName>" and the
element node itself doesn't 
even get created on the tree if the element is missing in the document.

I appreciate if you could tell me how I can get the schema default values
for the elements which are missing or
have empty content in the document?

Thanks,
-- zhamak

<<attachment: winmail.dat>>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]