V
V
Vanes Ri_Lax2015-12-14 15:55:03
XSL & XSLT
Vanes Ri_Lax, 2015-12-14 15:55:03

How to check an additional property for emptiness?

Hello,
I am making a site on hostCMS 6
created an IS (information system), in it an additional field called dop_url, ticked so that 1 IS element has one additional field
How do I do a type check:

if(dop_url == ''){
// делаю что то
}
if(dop_url != ''){
// делаю что то другое
}

Here's how I tried to do it:
<xsl:choose>
            <xsl:when test="property_value[tag_name='dop_url']/value != ''">
               <!--Делать что то -->
            </xsl:when>
            
            <xsl:when test="property_value[tag_name='dop_url']/value == ''">
               <!--делать что то другое -->
            </xsl:when>
            
         </xsl:choose>

But it gives an error, what am I doing wrong?
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VaneS Ri_Lax, 2015-12-24
@vanesxl

Solution:

<xsl:choose>
    <xsl:when test="property_value[tag_name='dop_url' and value != '']">
    </xsl:when>
    <xsl:otherwise>
    </xsl:otherwise>
</xsl:choose>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question