Oracle9i XML API Reference - XDK and Oracle XML DB Release 2 (9.2) Part Number A96616-01 |
|
Using the transformation specified by the XSLT stylesheet, the XSLT processor can converts an XML document into another text format.
This chapter contains these sections:
The oraxsl class provides a command-line interface to applying stylesheets on multiple XML documents. It accepts a number of command-line options that dictate how it should behave.
public class oraxsl extends java.lang.Object java.lang.Object | +--oracle.xml.parser.v2.oraxsl
java oraxsl options* source? stylesheet? result?
Method | Description |
---|---|
Class constructor. |
|
Invokes the oraxsl driver |
Class constructor.
public oraxsl();
Invokes the oraxsl driver.
public static void main( String[] args);
Parameter | Description |
---|---|
args |
Command line arguments. |
Indicates that an exception occurred during XPath processing.
public class XPathException extendsoracle.xml.parser.v2.XSLException
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--oracle.xml.util.XMLException | +--oracle.xml.parser.v2.XSLException
| +--oracle.xml.parser.v2.XPathException
java.io.Serializable
Method | Description |
---|---|
Retrieves error id. |
|
Retrieves error message. |
Retrieves error id.
public int getErrorID();
Retrieves error message. The options are described in the following table.
Parameter | Description |
---|---|
err |
XMLError class used to get the error message. |
Indicates that an exception occurred during XSL transformation.
public class XSLException extends oracle.xml.util.XMLException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--oracle.xml.util.XMLException | +--oracle.xml.parser.v2.XSLException
XPathException
java.io.Serializable
Generates a new XSL exception.
public XSLException( String mesg);
Base element for extension elements
public class XSLExtensionElement oracle.xml.parser.v2.XSLExtensionElement
Default constructor.
public XSLExtensionElement();
Retrieves an attribute value as template.
protected final String getAttributeTemplateValue( XSLTContext
context,
String namespace,
String name);
Parameter | Description |
---|---|
context |
XSLT Context. |
namespace |
Namespace of the attribute. |
name |
Name of the attribute. |
Retrieves the value of an attribute.
protected final String getAttributeValue( String namespace, String name);
Parameter | Description |
---|---|
namespace |
Namespace of the attribute |
name |
Name of the attribute |
Retrieves the childNodes of the extension elements as a nodelist.
protected final java.util.Vector getChildNodes();
Executes the body of the extension elements.
public void processAction( XSLTContext
context);
Parameter | Description |
---|---|
context |
XSLT Context. |
Processes contents of the extension element.
protected final void processContent(XSLTContext
context);
Parameter | Description |
---|---|
context |
XSLTContext. |
This class provides methods to transform an input XML document using a previously constructed XSLStylesheet
. The transformation effected is as specified by the XSLT 1.0 specification.
public class XSLProcessor oracle.xml.parser.v2.XSLProcessor
Default constructor.
public XSLProcessor();
Retrieves the value of top-level stylesheet parameter.
public Object getParam( String uri, String name);
Parameter | Description |
---|---|
uri |
Namespace URI of the parameter. |
name |
Local name of the parameter. |
Constructs and returns a new XSLStylesheet. Throws an XSLException
. The options are described in the following table.
Parameter | Description |
---|---|
xsl |
XSL input. |
Transforms the input XML document. Throws an XSLException
on error. The options are described in the following table.
Removes the value of a top-level stylesheet parameter. Throws an XSLException
on error.
public void removeParam( String uri, String name);
Parameter | Description |
---|---|
uri |
URI of parameter. |
name |
parameter name. |
Resets all the params set. Throws an XSLException
on error.
public void resetParams();
Sets base url to resolve include/import hrefs. EntityResolver if set is used before using the base url. See also setEntityResolver().
public void setBaseURL(java.net.URL url);
Parameter | Description |
---|---|
url |
Base URL to be set. |
Sets entity resolver to resolve include/import hrefs. If not set, base url (if set) is used.
public void setEntityResolver( org.xml.sax.EntityResolver eResolver);
Parameter | Description |
---|---|
eResolver |
Entity resolver |
Creates an output stream for the output of warnings. If an output stream for warnings is not specified, the processor will not output any warnings.
public final void setErrorStream(java.io.OutputStream out);
Parameter | Description |
---|---|
out |
The output stream to use for errors and warnings. |
Applications can use this to set the locale for error reporting.
public void setLocale( java.util.Locale locale);
Parameter | Description |
---|---|
locale |
Locale to set. |
Sets the value of a top-level stylesheet parameter. The parameter value is expected to be a valid XPath expression (note that string literal values would therefore have to be explicitly quoted). The param functions CANNOT be used along with param functions in XSLStylesheet. If the param functions in XSLProcessor are used, any parameters set using XSLStylesheet functions will be ignored. Throws an XSLException
on error.
public void setParam( String uri, String name, Object value);
Parameter | Description |
---|---|
uri |
URI of parameter. |
name |
Parameter name. |
value |
Parameter value; Strings are treated as XPath Expr for backward compatibility). |
Switch to determine whether to output warnings.
public final void showWarnings( boolean flag);
Parameter | Description |
---|---|
flag |
Determines if warning should be shown; default: warnings not output. |
The class holds XSL stylesheet information such as templates, keys, variables, and attribute sets. The same stylesheet, once constructed, can be used to transform multiple XML documents.
public class XSLStylesheet oracle.xml.parser.v2.XSLStylesheet
Field | Syntax | Description |
---|---|---|
output |
public oracle.xml.parser.v2.XSLOutput output |
Output |
Returns the decimal format symbols specified in the stylesheet.
public java.text.DecimalFormatSymbols getDecimalFormat( NSName
nsname);
Parameter | Description |
---|---|
nsname |
Qualified name from xsl decimal-format. |
Returns the value of the encoding specified in xsl:output.
public String getOutputEncoding();
Returns the value of the media-type specified in xsl:output.
public jString getOutputMediaType();
Returns the output properties specified in xsl:output
as java.util.Properties
.
public java.util.Properties getOutputProperties();
Returns a JAXP Transformer object that uses this stylesheet for transformation.
public javax.xml.transform.Transformer newTransformer();
Class for Xpath processing Context.
public class XSLTContext extends java.lang.Object java.lang.Object | +--oracle.xml.parser.v2.XSLTContext
Returns the current context node.
public XMLNode
getContextNode();
Returns the current context node position.
public int getContextPosition();
Returns the current context size.
public int getContextSize();
Returns the XMLError instance for reporting errors.
public XMLError
getError();
Returns variable at the given stack offset.
public getVariable( NSName
name,
int offset);
Parameter | Description |
---|---|
name |
name of the variable |
offset |
offset of the variable |
Reports characters to the current output handler.
public void reportCharacters( String data, boolean disableoutesc);
Reports a XMLNode to the current output handler.
public void reportNode( XMLNode
node);
Parameter | Description |
---|---|
node |
Node to be output. |
Sets the XMLError.
public void setError(XMLError
err);
Parameter | Description |
---|---|
err |
Instance of XMLError. |
|
Copyright © 2001, 2002 Oracle Corporation. All Rights Reserved. |
|