I have an XML similar to this one:
<parent>
<child>child's text</child>
<child>other child's text</child>
parent's text
</parent>
Note that it's allowed to have multiple child elements.
I'd like to know if the parent element has text outside of its children.
I've come up with this solution:
<xsl:if test="normalize-space(parent/child[1]) = normalize-space(parent)">
<xsl:text>No parent text</xsl:text>
</xsl:if>
I use parent/child[1]
because the normalize-space function doesn't accept a sequence as it's argument.
Is there a better way to do this?
(I've found this question on the topic but the answer is incorrect or the question is different)