[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

querying attribute?

Thomas R. Jones thomas.jones at maitreyasecurity.com
Wed Mar 18 13:06:10 PST 2009


  querying attribute?
Hello all, I have the following code:

<tests xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <rpminfo_test
xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux"
check="all" comment="apache2 is installed"
id="oval:com.maitreyasecurity:tst:674" version="1">
  <object object_ref="oval:com.maitreyasecurity:obj:674"/>
  <state state_ref="oval:com.maitreyasecurity:ste:500"/>
 </rpminfo_test>
</tests>

I am trying everything i can think of to return the attribute value but
am hanging up on the namespace(i think). I believe because the attribute
is not prefixed that it is located within a NULL namespace and not the
element default namespace declared----correct? 

Here is my xquery:

declare default element namespace
"http://oval.mitre.org/XMLSchema/oval-definitions-5#linux"; for $attr in
document("apache2.package.novell.maitreyasecurity.en_US.xml","inventory.a")/tests/rpminfo_test/@id return string($attr)

Ideas? Thank you for your time.
Thomas Jones



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.