Specifications

Result data types
The value of an XPath expression can have several data types (a node set with several elements,
the text value of an attribute, a number returned by the count() function, the Boolean result of
a comparison). The value is converted to one of the data types string, number, or Boolean using
XPath 1.0 semantics – which may very well differ from the conversion semantics in the scripting
language. For example the XPath 1.0 conversion from string to Boolean returns true for all
non-empty strings (including the string “false”).
Query functions
Evaluates the XPath 1.0 expression against the backing
file and returns the result after converting it to a string
value with the XPath 1.0 string() function.
evalToString( xpath : String,
prefix-map : Map ) : String
Evaluates the XPath 1.0 expression against the backing
file and returns the result after converting it to a numeric
value with the XPath 1.0 number() function.
evalToNumber( xpath : String,
prefix-map: Map ) : Number
Evaluates the XPath 1.0 expression against the backing
file and returns the result after converting it to a Boolean
value with the XPath 1.0 boolean() function.
evalToBoolean( xpath : String,
prefix-map: Map ) : Boolean
JDF data model
The JDF data model describes a class that inherits all functions described in the Dataset class.
Query language
The JDF data model expects an XML backing file that conforms to the JDF 1.3 specification. A JDF
instance describes a nested structure of JDF nodes and their resources. The result is a nicely
structured XML file which can be validated by an XML schema. The JDF specification uses XPath
1.0 notation to refer to items in a JDF instance. Thus it is appropriate to use this notation to locate
items in a query.
The current implementation of the JDF data model in fact considers the underlying XML file with
some limited JDF-specific functionality layered on top.
Namespaces
Namespace prefixes in the query expression are resolved into namespace URIs using the prefix
map provided to the query functions as a second argument. If the map argument is omitted or
null, the default prefix map is used for resolving prefixes.
A JDF instance is required to set its default namespace to the JDF namespace, and all XML elements
and attributes described in the JDF specification reside in this namespace. XPath 1.0 however
does not have the concept of a default namespace. Therefore the default prefix map for the JDF
data model includes a definition of the “jdf” prefix (in addition to any other prefixes defined
in the backing file), and JDF query expressions should explicitly use this prefix.
A JDF instance may contain elements or attributes in other namespaces, allowing third-party
extensions to the specification. The query functions allow providing a prefix map to enable
accessing these extensions.
479
Enfocus Switch 10