xpath query on xml documents with multiple namespaces
Posted: Wed Dec 19, 2007 10:11 pm
using oxygenxml 9.1 on eclipse 3.3
In the xml editor:
trying to query with xpath (ctrl-shift-/) :
//ConversionRateResult -- gives "no results"
-- why??
if i would change the xml not to use a prefix for the inner namespace (such as ns0):
then //ns0:ConversionRateResult
yields: "Invalid XPath expression Prefix must resolve to a namespace: ns0"
Anything that I am doing wrong?
Adrian.
In the xml editor:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ConversionRateResponse xmlns="http://www.webserviceX.NET/">
<ConversionRateResult>3.9455</ConversionRateResult>
</ConversionRateResponse>
</soap:Body>
</soap:Envelope>
//ConversionRateResult -- gives "no results"
-- why??
if i would change the xml not to use a prefix for the inner namespace (such as ns0):
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ns0:ConversionRateResponse xmlns:ns0="http://www.webserviceX.NET/">
<ns0:ConversionRateResult>3.9455</ns0:ConversionRateResult>
</ns0:ConversionRateResponse>
</soap:Body>
</soap:Envelope>
yields: "Invalid XPath expression Prefix must resolve to a namespace: ns0"
Anything that I am doing wrong?
Adrian.