If the variable requestedSecurityToken does not hold a Document, but
rather holds the RequestSecurityTokenResponse element, then the xpath
expression should start with
"wst:AppliesTo/..." or "./wst:AppliesTo". In general, the xpath
expression should be relative to the context node which is the
argument of xpath.selectSingleNode().
Jeff
On 7/25/07, Jochen Zink <[EMAIL PROTECTED]> wrote:
Hello,
I try to use Axiom with XPath and Namespaces.
My XML I want to parse is the following:
<RequestSecurityTokenResponse
xmlns="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wsp:AppliesTo
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsa:EndpointReference
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing/">
<wsa:Address>https://www.vdg-portal.de/VDGAuthPortal/services/TicketService</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
</RequestSecurityTokenResponse>
I want the wsa:Address Element.
I guess it goes like this:
AXIOMXPath xpath = new AXIOMXPath( "/wst:RequestSecurityTokenResponse/" +
"wsp:AppliesTo/" +
"wsa:EndpointReference/" +
"wsa:Address");
xpath.addNamespace( "wst",
"http://schemas.xmlsoap.org/ws/2005/02/trust" );
xpath.addNamespace( "wsp",
"http://schemas.xmlsoap.org/ws/2004/09/policy" );
xpath.addNamespace( "wsa",
"http://schemas.xmlsoap.org/ws/2004/08/addressing/" );
OMElement address = (OMElement)
xpath.selectSingleNode(requestedSecurityToken);
But the address Element is null. What do I wrong?
Thanks a lot!
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]