I have the following XML code that I am trying to convert using xlst:
<setting> <type>house</type> <context>roof</context> <value>blue</value> </setting> <setting> <type>house</type> <context>kitchen</context> <value>red</value> </setting> <setting> <type>house</type> <context>floor</context> <value>black</value> </setting> <setting> <type>apartment</type> <context>roof</context> <value>red</value> </setting>
I want to calculate if the setting-> type "flat" has "context-> gender".
I tried to do this with
<xsl:if test="count(setting[type='apartment'] and setting[context='floor']) < 1"> </xsl:if>
but it does not seem to work. Am I getting an exception due to trying to turn a number into a boolean? Any suggestions?
update: I realized that I can use:
<xsl:if test="count(setting[type='apartment' and context='floor']) < 1">
source share