WAS v8.5 > Develop applications > XML applications > Use the XML API to perform operationsPerforming basic operations
We can use this information to help to perform basic XPath, XSLT, and XQuery operations.
- Perform basic XPath operations.
- Perform basic XSLT operations.
- Perform basic XQuery operations.
- View the results.
- Serialize the results.
- Navigate with XSequenceCursor.
- Navigate with XTreeCursor.
Subtopics
- Overview of the XML API
WAS v8.5 provides the IBM XML Application Programming Interface in support of the XML standards. This application programming interface invokes a runtime engine that is capable of executing XPath 2.0, XSLT 2.0, and XQuery 1.0 as well as manipulating the returned XML data.- Choose between the compiler and the interpreter
We can use either the compiler and the interpreter for preparing and executing an XQuery expression, XPath expression, or XSLT stylesheet. Choosing which one to use is very application specific and depends on several factors.- Use static and dynamic contexts
We can use the two context interfaces the XML API provides—XStaticContext and XDynamicContext.- Map XML types to Java types
We can use this mapping between XML types and Java types when using external functions and variables. They are recommended mappings only; other types might work subject to type promotion, casting rules, and the range of values representable by the target type.- Performing basic XPath operations
We can use the XPathExecutable instances created using XFactory.prepareXPath methods to evaluate XPath expressions.- Performing basic XSLT operations
We can use the XSLTExecutable instances created using XFactory.prepareXSLT methods to perform XSLT transformations.- Performing basic XQuery operations
We can use the XQueryExecutable instances created using XFactory.prepareXQuery methods to evaluate XQuery expressions.- View the results
After the application has prepared or loaded the XExecutable object for an XPath expression (an XPathExecutable object), an XSLTstylesheet (an XSLTExecutable object), or an XQuery expression (an XQueryExecutable object), you apply the XExecutable object to some input and then do something with the result. The source of the input that you provide and what you would like to do with the result determine which of the execute methods we use.- Serializing the results
After the application has evaluated an XPath or XQuery expression or performed a transformation with an XSLT stylesheet, you might want to write the output as an actual XML document represented as a file or as a Java string. The process of rendering results as an XML document is known as serialization.- Navigating with XSequenceCursor
The XSequenceCursor interface gives you a view of your sequence data.- Navigating with XTreeCursor
We can use the XTreeCursor interface to view your data.
Related concepts:
Overview of the XML API
Related
Choose between the compiler and the interpreter
Use static and dynamic contexts
Map XML types to Java types
Performing basic XPath operations
Performing basic XSLT operations
Performing basic XQuery operations
View the results
Serializing the results
Navigating with XSequenceCursor
Navigating with XTreeCursor