xsl-list
[Top] [All Lists]

Re: [xsl] XPath that returns nothing

2011-09-26 20:50:39
On Mon, 2011-09-26 at 23:17 +0200, Olivier Lefevre wrote:
What is the best XPath expression that is guaranteed to return nothing?
(best in the sense of simplest, always works and costs as little as
possible to evaluate). I was hoping it'd be the empty string but that
seems forbidden.

*[0] or *[false()]
might do it in both xpath 1 and 2.

Hmm, depending on the evaluation context, /*[false()] is safer - e.g.
since this is the XSL list, you may not have a context item.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--