XML Script logo
Using exists()
Code
<_data >
	<test0 value="0" />
	<test1 value="" />
	<test2 />
	<test3 value="hello" />
</_data>
Old test:
<_if test="test0.value" ><then >Caloo! - 0</then></_if>
<_if test="test1.value" ><then >Caloo! - 1</then></_if>
<_if test="test2.value" ><then >Caloo! - 2</then></_if>
<_if test="test3.value" ><then >Caloo! - 3</then></_if>
New test:
<_if test="exists(test0.value)" ><then >Calay! - 0</then></_if>
<_if test="exists(test1.value)" ><then >Calay! - 1</then></_if>
<_if test="exists(test2.value)" ><then >Calay! - 2</then></_if>
<_if test="exists(test3.value)" ><then >Calay! - 3</then></_if>
Output

Old test:

Caloo! - 3
New test:
Calay! - 0
Calay! - 1

Calay! - 3
Ref

x.9001

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited