Specifications

Generic XPath querying
The JDF data model implementation offers two types of query mechanisms. The first mechanism
allows evaluating an arbitrary XPath 1.0 expression with the same semantics as those in the XML
data model, i.e. the expression's value is converted to one of the data types string, number or
Boolean using XPath 1.0 semantics.
This generic mechanism supports complex queries that may involve multiple elements or attributes
(for example, counting the number of elements in a particular node set).
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 type querying
The second query mechanism uses an XPath 1.0 location path (not an arbitrary expression) to
indicate a single XML attribute or a single XML element, and thus to indicate a single text value.
This text value is then interpreted and converted to a script object according to the JDF data type
semantics described in the JDF specification.
The current implementation supports a limited subset of the JDF data types, as described in the
following table.
Supported JDF data typesQuery function
string, NMTOKEN, telem, textgetString()
any other data type (since everything is stored as text)
double, integer, LongIntegergetNumber()
booleangetBoolean()
date, dateTime, gYearMonthgetDate()
The query functions described below return the null object (as opposed to an empty string or a
zero number) if:
The location path does not evaluate to a single attribute or to a single element; for example
it evaluates to an empty node set, to a node set with two elements, to a comments node or
to a number.
The text value of the indicated attribute or element does not conform to the format for the
requested data type.
Returns the text value of the item at the specified XPath 1.0
location path. The text content of an element is concatenated
getString( xpath : String,
prefix-map : Map ) : String
480
Enfocus Switch 10