Syntax Essentials
The Standard namespace (std) contains the operations you will use in virtually every iXML service. These commands handle assigning, inspecting, converting, and formatting data, as well as controlling execution flow.
In this chapter
- Variables —
set,unset,null/true/false,assign,clone,swap,cast,eval,verbatim,global - Type Introspection —
typeof,instanceof,classinfo,equals - String Operations —
length/size,char/ord,concat,tolower/toupper,trim,pos,substr,pad,match,replace,split,convert - Output & Serialization —
output,header,sleep,serialize/unserialize - Conditionals —
if,is,switch - Loops —
for,foreach,while,repeat/until - Branching —
break,continue,return,exit
note
Documentation for include and param has been moved to Reusability and OOP to better align with function and class concepts.
Common pitfalls
<set var="x">42</set>creates a string, not an integer. Use<cast type="int"/>for numeric behavior.<assign>shares references for arrays/functions. Use<clone>for independent copies.<length>counts characters,<size>counts bytes. Choose based on whether you're working with text or binary data.- XML escaping in attributes:
<must be<and>must be>in attribute values. This commonly catches comparison operators:func="<".