According to my xslt, false OR false = true ... :-o Scary!
<xsl:variable name="alreadyRegistredFirst"><xsl:value-of select="boolean(umbraco.library:GetXmlNodeById($calendarid)/descendant::node [data [@alias='Kundnr']=$kundnr])"/></xsl:variable> <xsl:variable name="alreadyRegistredSecond"><xsl:value-of select="boolean(umbraco.library:GetXmlNodeById($calendarid)/descendant::node [data [@alias='Personnummer']=$pnumber and data [@alias='Foretag']=$foretag and data [@alias='Namn']=$name])"/></xsl:variable> <xsl:variable name="alreadyRegistred"><xsl:value-of select="$alreadyRegistredFirst or $alreadyRegistredSecond"/></xsl:variable>
(<xsl:value-of select="$alreadyRegistredFirst"/> OR <xsl:value-of select="$alreadyRegistredSecond"/> = <xsl:value-of select="boolean($alreadyRegistred)"/>)
This expression for $alreadyRegistred actually returns true even though both expressions it tests are false.
Thanks Peter, but may I ask, how should that change things to add an extra "= true"?
Moving in the whole selects inside the variable tag solved my problem, and with a logical reason to it all (I think), phew:
<xsl:variablename="alreadyRegistredFirst"select="boolean(umbraco.library:GetXmlNodeById($calendarid)/descendant::node [data [@alias='Kundnr']=$kundnr])"/> <xsl:variablename="alreadyRegistredSecond" select="boolean(umbraco.library:GetXmlNodeById($calendarid)/descendant::node [data [@alias='Personnummer']=$pnumber and data [@alias='Foretag']=$foretag and data [@alias='Namn']=$name])"/> <xsl:variablename="alreadyRegistred"select="$alreadyRegistredFirst or $alreadyRegistredSecond"/>
The reason for this might be that the $alreadyRegistredFirst and $alreadyRegistredSecond became string "false" instead of boolean false when the value was outside the variable-tag, right?
I'm not sure, but I do know that in some languages assigning a variable to true, upon re-using that variable isn't always treated as being boolean. You can't define if a variable is a string or a boolean or a number in XSLT.
Back to the beginning : OR does not behave
Hi!
According to my xslt, false OR false = true ... :-o Scary!
This expression for $alreadyRegistred actually returns true even though both expressions it tests are false.
What did I mess up this time?
Thanks alot for some help here
What happens if you try:
HTH,
Peter
Hi!
Thanks Peter, but may I ask, how should that change things to add an extra "= true"?
Moving in the whole selects inside the variable tag solved my problem, and with a logical reason to it all (I think), phew:
The reason for this might be that the $alreadyRegistredFirst and $alreadyRegistredSecond became string "false" instead of boolean false when the value was outside the variable-tag, right?
Regards
Jonas
I'm not sure, but I do know that in some languages assigning a variable to true, upon re-using that variable isn't always treated as being boolean. You can't define if a variable is a string or a boolean or a number in XSLT.
Glad you got it working though!
Regards,
Peter
Yeah, thanks, errors of this kind can be really painful sometimes.
is working on a reply...