From: "Tom Oehser" <[EMAIL PROTECTED]>
> ...
>
> > > <one xmlns='asdf'><two three='four'></two></one>
> > >
> > > //*[name()='one']/two/@three
>
> ...
>
> > We went 'round and 'round on this, and I think we're correct.
>
> ...
>
> So, in the case where I really am not sure what the namespace will be,
> or if there will even be one, as the spec I am working from is in flux
> with regard to the namespaces but not the elements, I have to do:
>
> //*[name()='one']//*[name()='two']/@three

Or you can bind your namespace URI to some prefix of your choice and have a
much nicer expression.

my:one/my:two/@three

So in other words, when dealing with namespaces its good to use prefixes in
XPath expressions.

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to