Check if a string is null or empty in XSLT

0

I have this XML code snippet and I need to check if it is empty:

<CNPJ>
    <xsl:if "cnpjContratado"!=NULL>
        <xsl:value-of select="cnpjContratado"/>
    </xsl:if>
</CNPJ>
<CPF>
    <xsl:if "cpfContratado"!=NULL>
        <xsl:value-of select="cpfContratado"/>
    </xsl:if>
</CPF>
    
asked by anonymous 14.02.2018 / 22:37

1 answer

0

Troubleshooting:

<CNPJ>
    <xsl:if test="cnpjContratado != NULL">
        <xsl:value-of select="cnpjContratado"/>
    </xsl:if>
</CNPJ>
<CPF>
    <xsl:if test="cpfContratado != NULL">
        <xsl:value-of select="cpfContratado"/>
    </xsl:if>
</CPF>
    
21.02.2018 / 14:55