Hi Varuna,

Please find my comments inline.

On Sun, Jul 13, 2008 at 12:27 PM, Varuna Jayasiri <[EMAIL PROTECTED]>
wrote:

> I need to clarify somethings about how namespaces are handled in XPath. I
> tried searching through tutorials and specifications but still have a few
> doubts.
>
> Can you please let me know how expressions such as *** are and *ns:** are
> handled when there are namespaces in the XML.
>
> e.g.
> *XML*
> <ns1:node xmlns:ns1="test">abc</ns1:node>
> <node>abc</node>
>
> XPath  1
> *


> *should this select node* with namespace


(Assuming that you meant to say "//*")
Yes it should.


>
>
> XPath 2
> ns:*
>
> should this select node without namespace
>

(assuming "//ns:*")
No.

However, if you are selecting a particular node, it should behave in a
different manner. For examples:

"//node" should result in only the second node and "//ns:node" should result
in only the first node.

HTH,
Dumindu.

-- 
Dumindu Pallewela
Cinergix - "Share, Reuse, Innovate"
cinergix.com

Reply via email to