I would say that that is the expected behavior.
XMLBeans is schema-aware. 
XPath is not. XPath operates on what is in your xml document, and if the
attribute
is not there, it won't find it.
- Wing Yew

-----Original Message-----
From: cbryant [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 29, 2006 4:52 PM
To: user@xmlbeans.apache.org
Subject: Querying Default values using XPath


Hi,

Our XSDs contain numerous instances of declared default values for
attributes. E.g.

<xs:attribute name="test" type="boolean" default="true" />

In cases where the attributes are not present in the Xml document,
querying
the attribute value via the generated XmlBeans accessor methods returns
the
default value as expected.

However, when selecting the same attribute with an XPath expression
using
the selectPath method (as we need to do, upon occasion), an empty array
is
returned.

Are we doing something wrong, or is this a deficiency in the XPath
support?

Thanks,
Coram Bryant
-- 
View this message in context:
http://www.nabble.com/Querying-Default-values-using-XPath-tf2186949.html
#a6050008
Sent from the Xml Beans - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to