Check whether a string is null or empty in XSLT

Asked

Viewed 211 times

0

I have this snippet of XML code and I need to check this blank:

<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>

1 answer

0


Problem solving:

<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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.