axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Greif" <jgr...@alumni.princeton.edu>
Subject Re: [Axiom] Using XPAth with namespaces
Date Wed, 25 Jul 2007 13:58:45 GMT
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 <jochenlist@web.de> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message