Hi,
I have a default value specified in the definition of the element. But the
generated class returns the default value only if the element exists in the
xml document.
schema:
<complexType name="SomeType">
<sequence>
<element name="name" type="string" minOccurs="1"/>
<element name="interval" type="long" minOccurs="0" default="1000" />
....
xml:
<root>
<name>AAA</name>
<interval />
...
getInterval() returns default value, but if 'interval' node doesn't exists
in xml (according to minOccurs="0" ) getInterval() returns 0. Is that
designed behavior?
Suppose it is. I do have isxxxSpecified() method to determne the existence
of the element in the document, but whether a way to get programmaticaly the
default value specified in the schema (to prevent its double maintenance in
the schema and in the code)?
Thanks,
Gennady
--
View this message in context:
http://www.nabble.com/element-default-value-in-generated-classes-tp15611201p15611201.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]