André Mud wrote: > Hello, > > Thanks, that works. I don't however know why it works. Could you explain > what this statement does so I can adapt it for further use.
/ns2:postcode/text() will extract the text from an element with a local name of 'postcode' and a namespace of "http://wwwxxx.nl/xxxF/xr/x/x". The XPath evaluator does not interpret the ns2 prefix in the document, so it cannot match the namespace. /*[local-name()='postcode']/ will find any element whose local name is 'postcode', regardless of namespace. Hope that helps, Ronan > > > Ronan Klyne-2 wrote: >> André Mud wrote: >>> Hello, >>> >>> I'm trying to catch a value from the following response: >>> >>> <soap:Envelope >>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns3:synchroonAntwoordBericht >>> xmlns:ns1="http://www.xxx.nl/xxx/StUFxxx" >>> xmlns:ns2="http://wwwxxx.nl/xxxF/xr/x/x" >>> xmlns:ns3="http://xx/xx/xx"><ns3:body><ns3:ADR><ns2:postcode>1234CC</ns2:postcode><ns2:woonplaatsnaam>Homet</ns2:woonplaatsnaam><ns2:straatnaam>straat</ns2:straatnaam><ns2:huisnummer>145</ns2:huisnummer><ns2:huisletter/><ns2:huisnummertoevoeging>a</ns2:huisnummertoevoeging></ns3:ADR</soap:Body></soap:Envelope> >>> >>> I want to save 1234CC to a variable and use it further in the script. I >>> can't seem to extract it. >>> I use Visual XPATH to find the xpath command: >>> /soap:Envelope/soap:Body/ns3:synchroonAntwoordBericht/ns3:body/ns3:ADR/ns2:postcode/text() >> I think this will be a problem with the the XPath is executed. >> I suspect that there is no provision for declaring namespace prefixes. >> Try this one~: >> //*[local-name()='ADR']/*[local-name()='postcode']/text() >> >> >> # r >> >> -- >> Ronan Klyne >> Business Collaborator Developer >> Tel: +44 01189 028518 >> [EMAIL PROTECTED] >> www.groupbc.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > -- Ronan Klyne Business Collaborator Developer Tel: +44 01189 028518 [EMAIL PROTECTED] www.groupbc.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

