IBM FileNet P8, Version 5.2.1            

XPath and XSLT functions

This section contains a list of functions and the return values of the appropriate type from an XML string. The XML string can be stored in an XML data field or in a string data field.

Table 1. Table of functions that returns values from an XML string
Function What it does
xmlbooleanexpr Evaluates a Boolean XPath expression.
xmlintegerexpr Evaluates an integer XPath expression.
xmlfloatexpr Evaluates a float XPath expression.
xmlstringexpr Evaluates a string XPath expression.
xmlstringarrayexpr Evaluates a string array XPath expression.

The following functions manipulate an XML string

Table 2. Table of functions that manipulate an XML string
Function What it does
xmlinsertbefore Inserts an XML string into a source XML string before a particular node.
xmlinsertafter Inserts an XML string into a source XML string after a particular node.
xmlinsertchildfirst Inserts an XML string into a source XML string as the first child of a particular node.
xmlinsertchildlast Inserts an XML string into a source XML string as the last child of a particular node.
xmlremove Removes a node from an XML string.
xmlrename Renames a node in an XML string.
xmltransform Transforms an XML string using the specified style sheet.

xmlbooleanexpr

Returns the result of a Boolean XPath expression.

Use the following syntax:
xmlbooleanexpr (src, context, xpath_expr)
where:
Table 3. Parameters and description for the xmlbooleanexpr function
Parameter Description
src The source XML string
context String containing an XPath expression
xpath_expr String containing a Boolean XPath expression value

xmlintegerexpr

Returns the result of an integer XPath expression

Use the following syntax:
xmlintegerexpr (src, context, xpath_expr)
where:
Table 4. Parameters and description for the xmlintegerexpr function
Parameter Description
src The source XML string
context String containing an XPath expression
xpath_expr String containing an integer XPath expression value

xmlfloatexpr

Returns the result of a float XPath expression.

Use the following syntax:
xmlfloatexpr (src, context, xpath_expr)
where:
Table 5. Parameters and description for the xmlfloatexpr function
Parameter Description
src The source XML string
context String containing an XPath expression
xpath_expr String containing a float XPath expression value

xmlstringexpr

Returns the result of a string XPath expression.

Use the following syntax:
xmlstringexpr (src, context, xpath_expr)
where:
Table 6. Parameters and description for the xmpstringexpr function
Parameter Description
src The source XML string
context String containing an XPath expression
xpath_expr String containing a string XPath expression value

xmlstringarrayexpr

Returns the result of a string array XPath expression.

Use the following syntax:
xmlstringarrayexpr (src, context, xpath_expr)
where:
Table 7. Parameters and description for xmlstringarrayexpr function
Parameter Description
src The source XML string
context String containing an XPath expression
xpath_expr String containing a string array XPath expression value

xmlinsertbefore

Inserts a string before a particular XPath expression

Use the following syntax:
xmlinsertbefore (src, context, xpath_expr, token)
where:
Table 8. Parameters and description for the xmlinsertbefore function
Parameter Description
src The source XML string
context The location path from src to start the xpath_expr evaluation.
xpath_expr String returning a single node of src where token will be inserted
token String to be inserted before the node returned by xpath_expr

xmlinsertafter

Inserts a string after a particular XPath expression

Use the following syntax:
xmlinsertafter (src, context, xpath_expr, token)
where:
Table 9. Parameters and description for xmlinsertafter function
Parameter Description
src The source XML string
context The location path from src to start the xpath_expr evaluation.
xpath_expr String returning a single node of src where token will be inserted
token String to be inserted after the node returned by xpath_expr

xmlinsertchildfirst

Inserts a string as a first child node of the returned node.

Use the following syntax:
xmlinsertchildfirst (src, context, xpath_expr, token)
where:
Table 10. Parameters and description for xmlinsertchildfirst function
Parameter Description
src The source XML string
context The location path from src to start the xpath_expr evaluation.
xpath_expr String returning a single node of src where token will be inserted
token String to be inserted as the first child node of the node returned by xpath_expr

xmlinsertchildlast

Inserts a string as the last child node of the returned node.

Use the following syntax:
xmlinsertchildlast (src, context, xpath_expr, token)
where:
Table 11. Parameters and description for xmlinsertchildlast function
Parameter Description
src The source XML string
context The location path from src to start the xpath_expr evaluation.
xpath_expr String returning a single node of src where token will be inserted
token The string to be inserted as the last child node of the node returned by xpath_expr

xmlremove

Removes the node returned by xpath_expr.

Use the following syntax:
xmlremove (src, context, xpath_expr)
where:
Table 12. Parameters and description for the xmlremove function
Parameter Description
src The source XML string
context The location path from src to start the xpath_expr evaluation.
xpath_expr The string to be removed

xmlrename

Renames the node returned by the xpath_expr to new_name. The context is the location path from src to start the xpath_expr evaluation.

Use the following syntax:
xmlrename (src, context, xpath_expr, new_name)
where:
Table 13. Parameters and description for the xmlrename function
Parameter Description
src The source XML string
context The location path from src to start the xpath_expr evaluation
xpath_expr Node to be renamed
new_name The new name of the node

xmltransform

Returns the transformation of the <src> parameter based on the style sheet. The style sheet must be an XSLT style sheet. Note that no Java™ code is supported in the style-sheet.

Use the following syntax:
xmltransform (src, style-sheet)
where:
Table 14. Parameters and description for the xmltransform function
Parameter Description
src The source XML string
style-sheet A string expression containing either an XSLT style sheet or the filename of an XSLT style sheet. If it is a filename, the file must reside in the <PE Install Dir>/data/pesvr.<virtualserver>/xsl directory (<PE Install Dir>\data\pesvr.<virtualsdrver>\xsl in Windows) or a subdirectory.


Last updated: October 2015
bpfe015.htm

© Copyright IBM Corporation 2015.