[xquery-talk] request: get the attribute value
dengping wei
dengpingwei at gmail.com
Wed Sep 2 13:36:50 PDT 2009
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
More information about the talk
mailing list