lincolnneal
New Member
Given the following document, I want to extract \[code\]tns:EchoResponse\[/code\]. (Original document prettified for readability.)\[code\]<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <tns:EchoResponse xmlns:tns="http://www.apis-it.hr/fin/2012/types/f73" xsi:schemaLocation="http://www.apis-it.hr/fin/2012/types/f73 FiskalizacijaSchema.xsd " > hello </tns:EchoResponse> </soap:Body></soap:Envelope>\[/code\]I've parsed the document, I've created an XPath context, I've registered the namespaces \[code\]soap\[/code\] and \[code\]tns\[/code\], and then I've run the query using the following XPath expression.\[code\]//soap:Envelope[1]/soap:Body[1]/tns:EchoResponse[1]\[/code\]Unfortunately, only lookup that ignores namespaces and uses only the local name seems to work:\[code\]//*[local-name(.) = 'Envelope']/*[local-name(.) = 'Body'][1]/*[local-name(.) = 'EchoResponse'][1]\[/code\]So