I have a simple XML structure like
<main>
<node1><!-- comments --><!-- comments --></node1>
</main>
and this can have any number of sub-nodes or values like:
<main>
<node1><!-- comments --><!-- comments --><p>texttext text</p>
more text <br/></node1>
</main>
I want to check if the node <node1> is empty or not:
Condition: the node can still have comments in it and it should be still marked as empty
I'm doing something like:
<xsl:if test="string-length(main/node1//text())>0">
But it does not work as if there are multiple <p> tags, then string-length function will break because of multiple arguments.
Any help to solve this issue is really appreciated.