Thanks,

but is it not possible to use addNamespace() Methode? 

regards.
Jochen

> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> Gesendet: 25.07.07 12:03:32
> An: [email protected]
> Betreff: Re: [Axiom] Using XPAth with namespaces


> Hi,
> 
> you can try to get around this problem by changing the XPath expression:
> 
> For instance you can rewrite the query
> 
> //ex:TITLE   (with xmlns:ex="http://www.example.com/cds";)
> 
> as
> 
> //*[local-name(.) = 'TITEL' and namespace-uri(.) = 
> 'http://www.example.com/cds']
> 
> Not exactly the most pretty XPath expression, but should also work with 
> AXIOm without using the addNamespace() method...
> 
> /philipp
> 
> Jochen Zink 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]
> 
> 


_______________________________________________________________________
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]

Reply via email to