There is xml (30K lines) which at the 1st processing stage should be turned into a template.
<Test> <data_type>numeric</data_type> <value>83.79</value> </Test> <OBJECTIVE> <data_type>string</data_type> <value>string</value> </OBJECTIVE> <EDITIONDATE> <data_type>string</data_type> <value>string</value> <date_format>yyyyDDD</date_format> </EDITIONDATE> If you rely on value and depending on it value = 83.79 - 1 logic value = string check if date_format is on the same level if there is a date. I concocted
<xsl:template match="//value"> <xsl:variable name="val" select="string(value)"/> <xsl:choose> <xsl:when test="$val = string"> <xsl:text>string</xsl:text> </xsl:when> <xsl:when test="$val=83.79"> <xsl:text>numeric</xsl:text> </xsl:when> </xsl:choose> </xsl:template> He works out only the 2nd, because he always thinks that 83.79 he was looking for a cast was not found. What should the template look like solving my problem?