ï
Try using //*[local-name(.)='message']
 
This neutralizes the effects of namespaces.
 
/Suresh
-----Original Message-----
From: Phil Weighill-Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 6:27 PM
To: [EMAIL PROTECTED]
Subject: Re: Problem reading XML with XPath

Don't know if I've got the wrong end of the stick but XPath doesn't work like XML with respect to default namespaces: XPath doesn't support default namespaces (no prefix == no namespace). You must ensure that any XPath is specified with a prefix that maps to the XML's default namespace (the prefix can be any prefix string you like).

E.g.

<myxml xmlns="blah">
    <something>
        text
    </something>
</myxml>

can be queried thus:

//prefix:myxml/prefix:something/text()

with "prefix" mapped to "blah".

hth.

Phil :n.

On Thu, 2004-10-21 at 13:51, Luca Manganelli wrote:
Yanbin Ma wrote:

>If you change it to :
>Xmlns:mytag=http://schemas.xmlsoap.org/wsdl/
>
>It will work for you. -- Yanbin
>  
>
I cannot modify wsdl -- there are "fixed" ;)

But two questions:

1) why the Xpath doesn't work without above modification;
2) if there is another way to resolve the problem (without wsdl 
modification)

Thank you in advance ;)
Luca


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Phil Weighill-Smith <[EMAIL PROTECTED]>
Volantis Systems

Reply via email to