Specifications
Element is presentDescription of element contentsElement name
If type is string and if
regexp is not blank
A regular expression that matches the values
allowed for the field (relevant only if data type is
string)
format
If type is stringEquals "true" if the user is required to enter a
non-blank value, "false" otherwise (relevant only
if data type is string)
required
AlwaysThe value for the field:value
• For boolean data types: "true" or "false"
• For string data types: the value entered by the
user after removing any leading and trailing
white space (may be the empty string unless
required is set to true)
if type is choiceThe field's possible choicesitems
Introduction to XPath 1.0
XPath 1.0 is used in the Switch scripting API for querying the contents of XML documents in the
XML and JDF data models and in the XML module.
Note:
The current version of Switch does not support XPath 2.0.
Refer to the XPath 1.0 specification, the XML 1.0 specification, the XML namespaces specification,
and widely available literature for full details on XPath 1.0.
The remainder of this topic provides a brief introduction to a very small subset of XPath 1.0.
Expressions and location paths
XPath models an XML document as a tree of nodes. There are different types of nodes, including
element nodes, attribute nodes and text nodes. XPath defines a way to address specific nodes
in the node tree, to compute a string-value for each type of node and to perform more general
calculations with these values.
The primary construct in XPath is the expression. An expression is evaluated to yield an object,
which has one of the following four basic types:
• node-set (an unordered collection of nodes without duplicates).
• boolean (true or false).
• number (a floating-point number).
• string (a sequence of Unicode characters).
One important kind of expression is a location path. A location path selects a set of nodes. The
result of evaluating an expression that is a location path is the node-set containing the nodes
selected by the location path. Location paths can recursively contain expressions that are used
to filter sets of nodes.
327
Enfocus Switch 10