Skip to main content

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

  • Variablesset, unset, null/true/false, assign, clone, swap, cast, eval, verbatim, global
  • Type Introspectiontypeof, instanceof, classinfo, equals
  • String Operationslength/size, char/ord, concat, tolower/toupper, trim, pos, substr, pad, match, replace, split, convert
  • Output & Serializationoutput, header, sleep, serialize/unserialize
  • Conditionalsif, is, switch
  • Loopsfor, foreach, while, repeat/until
  • Branchingbreak, 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 &lt; and > must be &gt; in attribute values. This commonly catches comparison operators: func="&lt;".