XSLT test for text or everything



I'm merging two files, a WADL file and an XML file containing DITA fragments to ultimately generate a DITA file. the DITA fragments can be a string of text or a block of DITA tags. trying to determine if an element in the DITA fragments file is populated (or even exists) with the following test:



<xsl:variable name="docIDtext" select="$docId//doc[@id=$resourcepath]/*|text()"/>
<xsl:choose>
<xsl:when test="$docIDtext">
<xsl:copy-of select="$docIDtext"/>
</xsl:when>
<xsl:otherwise>
<draft-comment author="doc">FIXME: missing DocID</draft-comment>
</xsl:otherwise>
</xsl:choose>


however, the test for $docIDtext is always true, which is not the correct result. it's that pesky "*". How can I do this test?


No comments:

Post a Comment