You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Don Stewart <Do...@corizon.com> on 2005/04/08 12:14:24 UTC
How do I get this element :o)
Given the following SOAP Envelope :-
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<loginResponse xmlns="urn:partner.soap.sforce.com">
<result>
<passwordExpired>false</passwordExpired>
<serverUrl>https://na1-api.salesforce.com/services/Soap/u/5.0</serverUrl
>
<sessionId>4evpgJR1YdvlFc5LU0pE2.jPLX9qmf2NEW_h.RjwQM3.zUsbhMnl6XgVW4Ph5
FTNsgq3oAODeA_yyDR07EVUhzteaH1xyGi1</sessionId>
<userId>00530000000euXxAAI</userId>
</result>
</loginResponse>
</soapenv:Body>
</soapenv:Envelope>
I need to select the <login response>. Howerver, this redefines
(actually defines for the first time) the default namespace, and it's a
urn.
Using XmlBeans V2.x and Saxon what would the XPath expression be?
I have tried all I can think of but it eludes me as it's a urn.
I have had success with
lEnvelopeDoc.getEnvelope().getBody().selectChildren("urn:partner.soap.sf
orce.com", "loginResponse");
but this restures the contents and not the actual LoginResponseDocument
so I am trying to get the equiq. selectPath somthing like (but I know
not this is not correct) :-
lEnvelopeDoc.getEnvelope().getBody().selectPath("//urn:partner.soap.sfor
ce.com:loginResponse");
Many Thanks
Don