How to Use xql to get value from xml

Using Xojo 2014 r 2.1 on windows
I am getting a soap response and need to read the a:itemprice value from the returned xml. I have tried dozens of different examples but nothing seems to work correctly. I would prefer to use xql but getting an error that says invalid namespace prefix ‘a:price’
Can someone explain to me how to read the value?

I tried the following code from an online example but get the above error.

s is the returned xml from soap request

[code] dim map() as string = Array(“http://schemas.datacontract.org/2004/07/TVHWebServices”)

Dim theXmlNodeList As XmlNodeList = s.Xql( “a:price/a:itemprice”, map())

Dim theMyTagNode As XmlNode = theXmlNodeList.Item( 0 )

// Get the TextNode
Dim theXmlTextNode As XmlTextNode = XmlTextNode( theMyTagNode.Child( 0 ) )[/code]

Below it the xml that is returned and saved in variable s as xmldocument

<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/”>
<s:Body>


<a:errors/>
<a:pa>
<a:TVHWS.item_response>
<a:inv>
<a:TVHWS.inv>
<a:qty>1</a:qty>
<a:wh>1</a:wh>
</a:TVHWS.inv>
</a:inv>
<a:item>
<a:attributes>
<a:TVHWS.attribute>
<a:name>Description</a:name>
<a:value>PLUG - SPARK</a:value>
</a:TVHWS.attribute>
<a:TVHWS.attribute>
<a:name>Description2</a:name>
<a:value/>
</a:TVHWS.attribute>
<a:TVHWS.attribute>
<a:name>IsHAZ</a:name>
<a:value>False</a:value>
</a:TVHWS.attribute>
<a:TVHWS.attribute>
<a:name>IsNON</a:name>
<a:value>False</a:value>
</a:TVHWS.attribute>
<a:TVHWS.attribute>
<a:name>Backorderable</a:name>
<a:value>True</a:value>
</a:TVHWS.attribute>
<a:TVHWS.attribute>
<a:name>Weight</a:name>
<a:value>0,1</a:value>
</a:TVHWS.attribute>
</a:attributes>
<a:itemnumber>TSA/SY188</a:itemnumber>
</a:item>
<a:itemerror i:nil=“true”/>
<a:price>
<a:coreprice>0</a:coreprice>
<a:currency>USD</a:currency>
<a:itemprice>2.15</a:itemprice>
<a:listprice>2.05</a:listprice>
<a:qtybreaks>
<a:TVHWS.qtybreak>
<a:price>2.15000</a:price>
<a:qtycount>1</a:qtycount>
</a:TVHWS.qtybreak>
</a:qtybreaks>
</a:price>
<a:reqitem>
<a:id>1</a:id>
<a:itemnumber>sy188</a:itemnumber>
<a:quantity>1</a:quantity>
<a:reference>myref</a:reference>
<a:wh>1</a:wh>
</a:reqitem>
</a:TVHWS.item_response>
</a:pa>
<a:requestkey>myreq</a:requestkey>


</s:Body>
</s:Envelope>

I think that your namespace map is incorrect.

From the docs you need to provide the namespace followed by its schema:

Dim map() As String = Array("ns1","http://foo","ns2","http://bar")

So your code would need to be:

dim map() as string = Array("a","http://schemas.datacontract.org/2004/07/TVHWebServices")

Thank you so much. I works great now. I was just missing the “a”