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

request: get the attribute value

dengping wei dengpingwei at gmail.com
Wed Sep 2 13:36:50 PDT 2009


  request: get the attribute value
Dear all,

I have a question when I using xquery the get the attribute value of an
element.

when my query is
for $x in doc(\"aa.wsdl\")/wsdl:
definitions/wsdl:types/xsd:schema/xsd:complexType
return <node>{$x}</node>
It returns the results as follows:
<node>
   <xsd:complexType xmlns:tns="http://schemas.dmas.dfki.de/venetianblind"
                    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                    xmlns:impl="
http://dmas.dfki.de/axis/services/CarPrice-impl"
                    xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
                    xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/"
                    xmlns:intf="http://dmas.dfki.de/axis/services/CarPrice"
                    xmlns:apachesoap="http://xml.apache.org/xml-soap"
                    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns="http://dmas.dfki.de/axis/services/CarPrice"
                    name="PriceType"
                    sawsdl:modelReference="
http://127.0.0.1/ontology/concept.owl#Price">
        <xsd:sequence>
          <xsd:element name="currency" type="Currency"/>
          <xsd:element name="amount" type="xsd:float"/>
        </xsd:sequence>
      </xsd:complexType>
</node>

Then I want to get the value of attribute "name", I use the query
for $x in
doc(\"aa.wsdl\")/wsdl:definitions/wsdl:types/xsd:schema/xsd:complexType
return <node>{$x/@name}</node>

It works and return the results: <node name="PriceType"/>

But when I want to get value of attribute "sawsdl:modelReference", I use the
query

for $x in
doc(\"aa.wsdl\")/wsdl:definitions/wsdl:types/xsd:schema/xsd:complexType
return <node>{$x/@sawsdl:modelReference}</node>

It returns nothing. How could I get the value of the attribute "
sawsdl:modelReference"?

Thanks very much.



-- 
Dengping WEI
School of Computer Science,
National University of Defense Technology,
Changsha, Hunan  410073
P.R. China
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20090902/5f143868/attachment-0001.htm


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-2011 All Rights Reserved.