XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Beware of XPath expressions that produce false positives


On Sat, Sep 24, 2016 at 2:33 PM, Costello, Roger L. <costello@mitre.org> 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        cowan@ccil.org
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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS