Query Samples

Top  Previous  Next

Samples for  "Repeat | For Each", and "Bind Options" To properties

/courses/item

All "item" nodes under "courses"

//item

"item" nodes anywhere under the root

/courses/item[id = '5']

"/courses/item" nodes with an "id" node the value of which is 5

/courses/item[id = $courseno]

"item" nodes with an "id" node the value of which equals the value of the "courseno" XSL variable

$vof() usage samples

$vof(/courses/item/name)

The value of the first "/customers/item/name" node

$vof(//item/id)

The value of the first "item/id" node in XML

$vof(/courses/item[id = '5']/name)

The value of the "name" node under the first "/courses/item" node who has an "id" node that has a value of 5.

$vof(/courses/item)

The value of the first "item" node under the "/courses" node. If there are other nodes under "item" node, the value of all nodes will be retrieved.

$vof(/courses/item/name = 'Java' ? 'Our Language' ; /courses/item/name )

"Our Language" is returned if the value of the "name" node under the first under "/courses/item" is "Java", else the value of the "/courses/item/name" node is returned.

$vof(/courses/item[name = 'Java']/id = $courseno ? 'yes' ; 'no')        

If the value of "courseno" XSL variable is equal to the value of the "id" node under the first "/courses/item" node whose "name" node contains "Java" as value, "yes" is returned.  Otherwise, "no" is returned.