David Carlisle wrote:
Also you are classing attributes as non-empty content
<B foo=""/> is non empty but Ah, good catch David.
Okay, I added
namespace::*
to the XPath that David provided, to take into account namespaces. Here is the new XPath:
empty((node(),@*,namespace::*)) Here are the results I got from running my XSLT program using the new XPath:
Perfect!
Those results are from running SAXON in Oxygen XML. John and David pointed out I might get different results with another parser. Specifically, another parser might discard comments
and the whitespace in <B> </B>. Such a parser would produce these results:
Is there any way to write an XPath expression that always produces the results shown in the first table, regardless of which parser
is used? /Roger |