Performing basic operations
You can use this information to help you to perform basic XPath, XSLT, and XQuery operations.
Procedure
次主題
![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Overview of the XML API
The product 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.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Choosing between the compiler and the interpreter
You 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.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Using static and dynamic contexts
You can use the two context interfaces that the XML API provides—XStaticContext and XDynamicContext.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Mapping XML types to Java types
You 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.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Performing basic XPath operations
You can use the XPathExecutable instances that are created using XFactory.prepareXPath methods to evaluate XPath expressions.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Performing basic XSLT operations
You can use the XSLTExecutable instances that are created using XFactory.prepareXSLT methods to perform XSLT transformations.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Performing basic XQuery operations
You can use the XQueryExecutable instances that are created using XFactory.prepareXQuery methods to evaluate XQuery expressions.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Viewing the results
After your application has prepared or loaded the XExecutable object for an XPath expression (an XPathExecutable object), an XSLT stylesheet (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 you use.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Serializing the results
After your 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.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Navigating with XSequenceCursor
The XSequenceCursor interface gives you a view of your sequence data.![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Navigating with XTreeCursor
You can use the XTreeCursor interface to view your data.
Related concepts:
Related tasks:
作業主題
前次更新: July 9, 2016 8:14http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-base-dist&topic=txml_basic_ops
檔名:txml_basic_ops.html