Re: [xml-dev] Beware of XPath expressions that produce false positives

From
John Cowan <>
To
"Costello, Roger L." <>
Date
2016-09-24T18:38:10Z
ID
<CABzTEQDg2dhE6o9uOS=>
Thread
Re: [xml-dev] Beware of XPath expressions that produce false positives

On Sat, Sep 24, 2016 at 2:33 PM, Costello, Roger L. <[email protected]> wrote:

[Definition] An element is empty if and only if the element consists of a text node containing a string of length zero and nothing else (no attribute, comment, processing instruction, child element, or non-string value).

In general, there are no text nodes of length zero.  <B/> and its equivalent <B></B> contain only an element node.  Furthermore, parsers may discard comments, so you can't be sure whether <B><!--foo--></B> will be treated the same as <B/> or not.

-- 
John Cowan          http://vrici.lojban.org/~cowan        [email protected]
Cash registers don't really add and subtract;
        they only grind their gears.
But then they don't really grind their gears, either;
        they only obey the laws of physics.  --Unknown 





--
GMail doesn't have rotating .sigs, but you can see mine at http://www.ccil.org/~cowan/signatures