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.
Procedure
- Execute XSLT
- Location
- The product includes the following script that sets up the environment
and invokes the tool.
- Syntax
- Parameters
- -outputfile file
- Specifies that output should go to the specified file
By default,
the output is sent to standard out.
- -baseURI URI
- Specifies the base URI of the containing element
- -useCompiler
- Specifies compiler modes
If this parameter is not specified,
the default behavior is to use interpreted mode.
- -bindVar name=varName value=varValue
- Bind an atomic value to a variable (XPath, XQuery) or a param
(XSLT)
The value must be valid for the type that was specified in
the static context (XPath), in the query (XQuery), or in the stylesheet
(XSLT) for the same name.
- varName
- Name of the variable (expressed localPart,namespaceURI)
Notes: - If the variable is in no namespace, the namespace URI should be
omitted.
- If the value of any option contains a blank space, enclose it
in quotation marks.
- Localpart is a required value.
- varValue
- Variable value
The -bindVar option can be used multiple times.
For
example:
-bindVar name=la,"http://www.ibm.com/Los Angeles" value="some value"
- -baseOutputURI URI
- Specifies the base URI to use when resolving result documents
The
default is either the base URI for the main result document or the
current working directory.
This option only applies when working
with XSLT.
- -XSLTinitMode mode
- Specifies a mode to use as the initial mode in an XSLT transformation
(expressed localPart,namespaceURI)
This option only applies when
working with XSLT.
For example:
-XSLTinitMode la,"http://www.ibm.com/Los Angeles"
- -XSLTinitTemplate template
- Specifies a named template to use as the initial template in an
XSLT transformation (expressed localPart,namespaceURI)
If a named
template is not set, the initial template is determined by the initial
mode, context node, and template matching rules.
This option
only applies when working with XSLT.
For example:
-XSLTinitTemplate la,"http://www.ibm.com/Los Angeles"
- -v
- Prints the version of the tool
- -h
- Prints the usage statement
- -input file
- Specifies the full path to a file containing an XML artifact against
which the stylesheet will be executed
- stylesheet
- Specifies the full path to a file containing the XSL stylesheet
The following is a basic example
of executing a stylesheet using the ExecuteXSLT tool:
- Execute an XPath expression
- Location
- The product includes the following script that sets up the environment
and invokes the tool.
- Syntax
- Parameters
- -outputfile file
- Specifies that output should go to the specified file
By default,
the output is sent to standard out.
- -cpm mode
- Specifies an alternate XPath compatibility mode
Valid values
are Latest, 1.0, and 2.0.
The default is 2.0.
- -ns prefix=URI
- Specifies a namespace for use during static processing
If the
value of any option contains a blank space, enclose it in quotation
marks.
This option can be used multiple times.
- -schema URI
- Specifies any schema document that is used to populate the in-scope
schema definitions
This option can be used multiple times.
- -var name=varName type=varType
- Adds a variable binding to the static context for a single item
This
simply declares the variable, and a value also must be bound to the
XDynamicContext.
- varName
- Indicates the name of the variable (expressed localPart,namespaceURI)
If
the variable is in no namespace, the namespace URI should be omitted.
Localpart
is a required value.
- varType
- Indicates the type of the variable (expressed localPart[, namespaceURI])
If the value of any option contains a blank
space, enclose it in quotation marks.
This option can be used
multiple times.
For example:
-var name=la,"http://www.ibm.com/Los Angeles" type=boolean,http://www.w3.org/2001/XMLSchema
- -baseURI URI
- Specifies the base URI of the containing element
- -dnet URI
- Specifies a default namespace URI for element and type names
The
namespace URI, if present, is used for any unprefixed QName appearing
in a position where an element or type name is expected.
- -useCompiler
- Specifies compiler modes
If this parameter is not specified,
the default behavior is to use interpreted mode.
- -bindVar name=varName value=varValue
- Bind an atomic value to a variable (XPath, XQuery) or a param
(XSLT)
The value must be valid for the type that was specified in
the static context (XPath), in the query (XQuery), or in the stylesheet
(XSLT) for the same name.
- varName
- Name of the variable (expressed localPart,namespaceURI)
Notes: - If the variable is in no namespace, the namespace URI should be
omitted.
- If the value of any option contains a blank space, enclose it
in quotation marks.
- Localpart is a required value.
- varValue
- Variable value
The -bindVar option can be used multiple times.
For
example:
-bindVar name=la,"http://www.ibm.com/Los Angeles" value="some value"
- -v
- Prints the version of the tool
- -h
- Prints the usage statement
- -input file
- Specifies the full path to a file containing an XML artifact against
which the XPath expression will be executed
- xpathfile
- Specifies the full path to a file containing the XPath expression
The following is a basic example
of executing an XPath expression using the ExecuteXPath tool:
- Execute an XQuery expression
- Location
- The product includes the following script that sets up the environment
and invokes the tool.
- Syntax
- Parameters
- -outputfile file
- Specifies that output should go to the specified file
By default,
the output is sent to standard out.
- -baseURI URI
- Specifies the base URI of the containing element
- -dnet URI
- Specifies a default namespace URI for element and type names
The
namespace URI, if present, is used for any unprefixed QName appearing
in a position where an element or type name is expected.
- -useCompiler
- Specifies compiler modes
If this parameter is not specified,
the default behavior is to use interpreted mode.
- -bindVar name=varName value=varValue
- Bind an atomic value to a variable (XPath, XQuery) or a param
(XSLT)
The value must be valid for the type that was specified in
the static context (XPath), in the query (XQuery), or in the stylesheet
(XSLT) for the same name.
- varName
- Name of the variable (expressed localPart,namespaceURI)
Notes: - If the variable is in no namespace, the namespace URI should be
omitted.
- If the value of any option contains a blank space, enclose it
in quotation marks.
- Localpart is a required value.
- varValue
- Variable value
The -bindVar option can be used multiple times.
For
example:
-bindVar name=la,"http://www.ibm.com/Los Angeles" value="some value"
- -v
- Prints the version of the tool
- -h
- Prints the usage statement
- -input file
- Specifies the full path to a file containing an XML artifact against
which the XQuery expression will be executed
- xqueryfile
- Full path to a file containing the XQuery expression
The following is a basic example
of executing an XQuery expression using the ExecuteXQuery tool: