Using the XML API to perform operations
You can use the IBM® XML Application Programming Interface (API) to perform operations that use the new and updated W3C XML standards.
Before you begin
Limitations of the processor:
- When using the namespace axis, only the namespaces declared on the current node are accessible through the namespace axis (rather than all of the namespaces that are in scope for the current node) if the input document supplied is a StreamSource, SAXSource, or StAXSource.
- When evaluating some string functions and operations, the processor might not handle Unicode characters with code points above #xFFFF correctly; it might incorrectly treat the surrogate pair in the UTF-16 encoding of the character as two separate characters.
- Whitespace text nodes might not be stripped from elements that have complex type with element-only content. When matching children of such an element, use a sequence type that matches only elements such as element() to avoid processing these text nodes.
- The column number reported in an error message relating to an operator expression might not point to the operand that is actually in error. Consider both operands when determining the cause of the error.
- Using a variable declared in an XQuery typeswitch
clause as an operand in an arithmetic expression might cause an error.When using the variable declared in an XQuery typeswitch clause in an arithmetic expression such as in the following example, the processor might incorrectly report a type error.
typeswitch (.) case $a as xs:integer return ($a + 1) default return 17
To work around this limitation, cast the variable to the expected type. For example:typeswitch (.) case $a as xs:integer return (($a cast as xs:integer) + 1) default return 17
Procedure
Subtopics
Building and running a sample XML application
You can use the IBM WebSphere® Application Server XML thin client, the com.ibm.xml.thinclient_9.0.jar file, to build a sample XML application. You can also use the API documentation to improve your understanding of the XML API.Running the IBM Thin Client for XML
The IBM Thin Client for XML with WebSphere Application Server allows applications to take advantage of IBM XML technology components in a simple Java™ environment. Such applications can directly access the XML API to process XPath, XQuery, and XSL in a Java SE runtime environment. You can bundle the Thin Client for XML library with your application by using the WebSphere Application Server installation. The Thin Client for XML also extends the choice of Java SE runtime environment. It can be run in IBM Java Runtime Environments (JREs) packaged with WebSphere Application Server as well as in the Windows and Linux JREs from Oracle Corporation, the JREs that are downloaded from the Oracle Corporation website, or the JRE that is downloaded from the HP website.Performing basic operations
You can use this information to help you to perform basic XPath, XSLT, and XQuery operations.Precompiling
You can use this information to help you to precompile an expression, query, or stylesheet.Using resolvers
You can use this information to help you to use resolvers.Using external variables and functions
You can use this information to help you to use external variables and functions.Creating items and sequences
You can use this information to help you to create items and sequences using the XItemFactory as well as to use sequence types.Working with collations
XSLT stylesheets and expressions in XQuery and XPath can refer to collations using collation URIs. A collation is a set of culture-specific rules that define how text should be sorted and which differences between two pieces of text are considered significant and which insignificant.Executing using the command-line tools
You can use the ExecuteXSLT tool to execute a stylesheet, use the ExecuteXPath tool to execute an XPath expression, and use the ExecuteXQuery tool to execute an XQuery expression.Using a message handler and managing exceptions
You can use this information to help you to use a message handler and mange exceptions.


File name: txml_using_xapi.html