functx:has-empty-content
Whether an element has empty content
Description
The functx:has-empty-content function returns true if the element has no content at all (not even whitespace.) This is in contrast to the fn:empty function, which will return true for any element regardless of whether it has any content.
To test whether an element has any content besides whitespace, see the functx:all-whitespace function.
Parameters |
Description |
---|---|
element:element() |
the XML element to test |
Examples
XPath |
Results |
---|---|
functx:has-empty-content($in-xml/a) |
true |
functx:has-empty-content($in-xml/b) |
true |
functx:has-empty-content($in-xml/c) |
false |
functx:has-empty-content($in-xml/d) |
false |
functx:has-empty-content($in-xml/e) |
false |
functx:has-empty-content($in-xml/f) |
false |
functx:has-empty-content($in-xml/g) |
false |