How can I determine whether a given node is present in my input xml?
If the node is present I would like to use the value of reportAuthor1, but otherwise I would use the value of reportAuthor. I have tried unsuccessfully to use if and else.
<xsl:choose>
<xsl:when test="reportAuthor1=''">
<xsl:value-of select="reportAuthor"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="reportAuthor1"/>
</xsl:otherwise>
</xsl:choose>
Use
not()to check whether a node doesn’t exist at all: