29/04/2014 Development / XPath

The following table lists the comparison operators for comparisons between operands (single operands or calculation expressions) of various data types.

Operator Description
=EQ Equal: True, if the value of operand1 is equal to the value of operand2.
<>NE Not Equal: True, if the value of operand1 is not equal to the value of operand2.
<LT Less Than: True, if the value of operand1 is less than the value of operand2.
>GT Greater Than: True, if the value of operand1 is greater than the value of operand2.
<=LE Less Equal: True, if the value of operand1 is less than or equal to the value of operand2.
>=GE Greater Equal: True, if the value of operand1 is greater than or equal to the value of operand2.

 

Comparison of the values takes place according to the comparison rules. 
 

Notes

  • The operators =<><><=, and >= are exactly the same as EQNELTGTLE, and GE.
  • It is recommended that you use only one type of operator in the context of a program. If you are unsure of which to use, the variant with the characters =<, and > is considered more modern, but can also lead to an overload of these characters. In contrast, the logical two-letter operators are more suited to other logical operators such as COCN, and so on, for which no alternative exists.
  • Due to comparison rules, the size comparisons shown here are not only suitable for determining a textual sequence of character-like data objects.
  • Outside of classes, the obsolete forms ><=<=> of relational operators can also still exist.
  •  
31/07/2009 Development / XPath

Use a função position() do XPath para selecionar um determinado nó.

<xsl:value-of select="count(data/Quotes/profiles/item[position()=6]/columns/item)"/>