xslutil:test

  • 5 August 2022
  • 0 replies
  • 0 views

Userlevel 2
Badge +2

This article is about the xslutil:test Blend function.

xslutil:test

Tests whether an XPath expression or comparison evaluates to true() or to false(), following USoft Blend rules for interpreting expressions as booleans. These rules are the same as the XPath rules except for converting strings to booleans.

Returns a boolean. Because of a Microsoft/C# convention, if USoft Blend outputs (serialises) a boolean value, it is printed capitalised, ie., as True or False, as opposed to XPath true or false.

Syntax

xslutil:test( { xpath-expression | comparison } )

The required argument is either an XPath expression or a comparison. It is a comparison if it contains one of the comparison operators =,  !=,  <=,  <,  >,  >=,  <>. In a comparison, both the left-hand operand and the right-hand operand are XPath expressions.

xslutil:test() applies different rules from XPath/XSLT when converting XPath expressions to booleans. Applying xslutil:test() to an expression is not the same as applying XPath boolean() to that expression.

 


0 replies

Be the first to reply!

Reply