Skip Headers

Oracle9i XML API Reference - XDK and Oracle XML DB
Release 2 (9.2)

Part Number A96616-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

3
XML Processing for Java (JAXP)

This chapter describes the JAXP APIs contained in the oracle.xml.parser.v2 package


JXDocumentBuilder Class


Description of JXDocumentBuilder

JXDocumentBuilder defines the APIs to obtain DOM Document instances from an XML document. Using this class, an application programmer can obtain a org.w3c.dom.Document from XML.

An instance of this class can be obtained from the DocumentBuilderFactory.newDocumentBuilder method. Once an instance of this class is obtained, XML can be parsed from a variety of input sources. These input sources are InputStreams, Files, URLs, and SAX InputSources.

Note that this class reuses several classes from the SAX API. This does not require that the implementor of the underlying DOM implementation use a SAX parser to parse XML document into a Document. It merely requires that the implementation communicate with the application using these existing APIs.


Syntax of JXDocumentBuilder

public class JXDocumentBuilder
 
oracle.xml.jaxp.JXDocumentBuilder


Methods of JXDocumentBuilder

Table 3-1 Summary of Methods of JXDocumentBuilder  
Method Description

getDOMImplementation()

Returns the associated DOM implementation object.

isNamespaceAware()

Indicates whether this parser understands namespaces.

isValidating()

Indicates whether this parser validates XML documents.

newDocument()

Obtains a new instance of a DOM Document object with which to build a DOM tree.

parse()

Parses the content of the given input source as an XML document and return a new DOM Document object.

setEntityResolver()

Specifies the EntityResolver to resolve entities present in the XML document to be parsed.

setErrorHandler()

Specifies the ErrorHandler to be used to resolve entities present in the XML document to be parsed.

getDOMImplementation()

Description

Returns the associated DOM implementation object that handles this document. A DOM application may use objects from multiple implementations.

Syntax

public org.w3c.dom.DOMImplementation getDOMImplementation();

isNamespaceAware()

Description

Indicates whether or not this parser is configured to understand namespaces.

Syntax

public boolean isNamespaceAware();

isValidating()

Description

Indicates whether or not this parser is configured to validate XML documents.

Syntax

public boolean isValidating();

newDocument()

Description

Obtains a new instance of a DOM Document object with which to build a DOM tree.

Syntax

public org.w3c.dom.Document newDocument();

parse()

Description

Parses the content of the given input source as an XML document and return a new DOM Document object. Throws the following exceptions:

Syntax

public org.w3c.dom.Document parse( org.xml.sax.InputSource is);

Parameter Description

is

InputSource containing the content to be parsed.

setEntityResolver()

Description

Specifies the EntityResolver to resolve entities present in the XML document to be parsed. If this is set to NULL, the underlying implementation uses its own default implementation and behavior.

Syntax

public void setEntityResolver( org.xml.sax.EntityResolver er);

Parameter Description

er

Entity Resolver.

setErrorHandler()

Description

Specifies the ErrorHandler to be used to resolve entities present in the XML document to be parsed. Setting this to null will result in the underlying implementation using it's own default implementation and behavior.

Syntax

public void setErrorHandler( org.xml.sax.ErrorHandler eh);

Parameter Description

eh

Error handler.


JXDocumentBuilderFactory Class


Description of JXDocumentBuilderFactory

Defines a factory API that enables applications to obtain a parser that produces DOM object trees from XML documents.


Syntax of JXDocumentBuilderFactory

public class JXDocumentBuilderFactory
 
oracle.xml.jaxp.JXDocumentBuilderFactory


Fields of JXDocumentBuilderFactory

Table 3-2 Fields of JXDocumentBuilderFactory  
Field Syntax Description

BASE_URL

public static final java.lang.String

BASE_URL

Base URL used in parsing entities.

DEBUG_MODE

public static final java.lang.String

DEBUG_MODE

Sets Debug Mode - Boolean.TRUE or Boolean.FALSE.

DTD_OBJECT

public static final java.lang.String

DTD_OBJECT

DTD Object to be used for validation.

ERROR_ENCODING

public static final java.lang.String

ERROR_ENCODING

Encoding for errors report through error stream (only if ERROR_STREAM is set).

ERROR_STREAM

public static final java.lang.String

ERROR_STREAM

Error stream for reporting errors. The object can be OutputStream or PrintWriter. This attribute is ignored if ErrorHandler is set.

NODE_FACTORY

public static final java.lang.String

NODE_FACTORY

Set NodeFactory to build custom Nodes.

SCHEMA_OBJECT

public static final java.lang.String

SCHEMA_OBJECT

Schema Object to be used for validation.

SHOW_WARNINGS

public static final java.lang.String

SHOW_WARNINGS

Boolean to ignore warnings - Boolean.TRUE or Boolean.FALSE.

USE_DTD_ONLY_FOR_VALIDATION

public static final java.lang.String

USE_DTD_ONLY_

FOR_VALIDATION

If true, DTD Object is used only for validation and is not added to the parser document.


Methods of JXDocumentBuilderFactory

Table 3-3 Summary of Methods of JXDocumentBuilderFactory  
Method Description

JXDocumentBuilderFactory()

Default constructor.

getAttribute()

Allows the user to retrieve specific attributes on the underlying implementation

isExpandEntityReferences()

Indicates if the factory is configured to produce parsers which expand entity reference nodes.

isIgnoringComments()

Indicates if the factory is configured to produce parsers which ignore comments.

isNamespaceAware()

Indicates if the factory is configured to produce namespace aware parsers.

newDocumentBuilder()

Creates a new instance of a DocumentBuilder using the currently configured parameters.

setAttribute()

Sets specific attributes on the underlying implementation.

JXDocumentBuilderFactory()

Description

Default constructor.

Syntax

public  JXDocumentBuilderFactory();

getAttribute()

Description

Allows the user to retrieve specific attributes on the underlying implementation; returns the value of the attribute. Throws IllegalArgumentException if the underlying implementation doesn't recognize the attribute.

Syntax

public Object getAttribute( String name);

Parameter Description

name

The name of the attribute.

isExpandEntityReferences()

Description

Indicates whether or not the factory is configured to produce parsers which expand entity reference nodes. Always returns TRUE; currently, there is no way to prevent entity references expansions.

Syntax

public boolean isExpandEntityReferences();

isIgnoringComments()

Description

Indicates whether or not the factory is configured to produce parsers which ignore comments. Always returns FALSE; currently, ignoring comments is not configurable.

Syntax

public boolean isIgnoringComments();

isNamespaceAware()

Description

Indicates whether or not the factory is configured to produce parsers which are namespace aware. Always returns TRUE; currently, there is no way to turn of Namespaces.

Syntax

public boolean isNamespaceAware();

newDocumentBuilder()

Description

Creates a new instance of a DocumentBuilder using the currently configured parameters. Throws ParserConfigurationException if a DocumentBuilder which satisfies the configuration requested cannot be created.

Syntax

public DocumentBuilder newDocumentBuilder();

setAttribute()

Description

Sets specific attributes on the underlying implementation. Throws IllegalArgumentException if the underlying implementation doesn't recognize the attribute.

Syntax

public void setAttribute( String name, Object value);

Parameter Description

name

The name of the attribute.

value

The value of the attribute.


JXSAXParser Class


Description of JXSAXParser

Defines the API that wraps an org.xml.sax.XMLReader implementation class. In JAXP 1.0, this class wrapped the org.xml.sax.Parser interface, however this interface was replaced by the XMLReader.

For ease of transition, this class continues to support the same name and interface as well as supporting new methods. An instance of this class can be obtained from the SAXParserFactory.newSAXParser method. Once an instance of this class is obtained, XML can be parsed from a variety of input sources. These input sources are InputStreams, Files, URLs, and SAX InputSources.

This static method creates a new factory instance based on a system property setting or uses the platform default if no property has been defined.

The system property that controls which Factory implementation to create is named "javax.xml.style.TransformFactory". This property names a class that is a concrete subclass of this abstract class. If no property is defined, a platform default will be used.

As the content is parsed by the underlying parser, methods of the given HandlerBase are called.


Syntax of JXSAXParser

public class JXSAXParser
 
oracle.xml.jaxp.JXSAXParser


Methods of JXSAXParser

Table 3-4 Summary of Methods of JXSAXParser  
Method Description

getProperty()

Returns the value of the requested property for in the underlying implementation of XMLReader.

getXMLReader()

Returns the XMLReader that is encapsulated by the implementation of this class.

isNamespaceAware()

Indicates if this parser is configured to understand namespaces.

isValidating()

Indicates if this parser is configured to validate XML documents.

setProperty()

Sets the particular property in the underlying implementation of XMLReader

getProperty()

Description

Returns the value of the requested property for in the underlying implementation of org.xml.sax.XMLReader. See also org.xml.sax.XMLReader#getProperty. Throws the following exceptions:

Syntax

public java.lang.Object getProperty( String name);

Parameter Description

name

The name of the property to be retrieved.

getXMLReader()

Description

Returns the XMLReader that is encapsulated by the implementation of this class.

Syntax

public XMLReader getXMLReader();

isNamespaceAware()

Description

Indicates whether or not this parser is configured to understand namespaces. Returns TRUE if the parser understands namespaces, FALSE otherwise.

Syntax

public boolean isNamespaceAware();

isValidating()

Description

Indicates whether or not this parser is configured to validate XML documents.

Syntax

public boolean isValidating();

setProperty()

Description

Sets the particular property in the underlying implementation of XMLReader. See also org.xml.sax.XMLReader#setProperty. Throws the following exceptions:

Syntax

public void setProperty( String name, 
                         Object value);

Parameter Description

name

The name of the property to be set.

value

The value of the property to be set.


JXSAXParserFactory Class


Description of JXSAXParserFactory

Defines a factory API that enables applications to configure and obtain a SAX based parser to parse XML documents.

Syntax

public class JXSAXParserFactory
 
oracle.xml.jaxp.JXSAXParserFactory


Methods of JXSAXParserFactory

Table 3-5 Summary of Methods of JXSAXParserFactory  
Method Description

JXSAXParserFactory()

Default constructor.

getFeature()

Returns the value of the requested property for in the underlying implementation of XMLReader.

isNamespaceAware()

Indicates if the factory is configured to produce namespace aware parsers.

newSAXParser()

Creates a new instance of a SAXParser using the currently configured factory parameters.

setFeature()

Sets the particular feature in the underlying implementation of XMLReader.

JXSAXParserFactory()

Description

Default constructor.

Syntax

public  JXSAXParserFactory();

getFeature()

Description

Returns the value of the requested property for in the underlying implementation of XMLReader. See also org.xml.sax.XMLReader#getProperty. Throws the following exceptions:

Syntax

public boolean getFeature( String name);

Parameter Description

name

The name of the property to be retrieved.

isNamespaceAware()

Description

Indicates whether or not the factory is configured to produce namespace aware parsers. Returns TRUE if the factory is configured for namespace aware parsers, FALSE otherwise.

Syntax

public boolean isNamespaceAware();

newSAXParser()

Description

Creates a new instance of a SAXParser using the currently configured factory parameters. Throws ParserConfigurationException if a parser which satisfies the requested configuration cannot be created.

Syntax

public SAXParser newSAXParser();

setFeature()

Description

Sets the particular feature in the underlying implementation of XMLReader. See also org.xml.sax.XMLReader#setFeature. Throws the following exceptions:

Syntax

public void setFeature( String name, boolean value);

Parameter Description

name

The name of the feature to be set.

value

The value of the feature to be set.


JXSAXTransformerFactory Class


Description of JXSAXTransformerFactory

A JXSAXTransformerFactory instance can be used to create Transformer and Templates objects.

The system property that determines which Factory implementation to create is named "javax.xml.transform.TransformerFactory". This property names a concrete subclass of the TransformerFactory abstract class (in our case, it is JXSAXTransformerFactory). If the property is not defined, a platform default is be used.

This class also provides SAX-specific factory methods. It provides two types of ContentHandlers, one for creating Transformers, the other for creating Templates objects.

If an application wants to set the ErrorHandler or EntityResolver for an XMLReader used during a transformation, it should use a URIResolver to return the SAXSource which provides (with getXMLReader) a reference to the XMLReader.


Syntax of JXSAXTransformerFactory

public class JXSAXTransformerFactory
 
oracle.xml.jaxp.JXSAXTransformerFactory


Methods of JXSAXTransformerFactory

Table 3-6 Summary of Methods of JXSAXTransformerFactory  
Method Description

JXSAXTransformerFactory()

The default constructor.

getAssociatedStylesheet()

Retrieves the stylesheet specification(s) associated through the xml-stylesheet processing instruction.

getAttribute()

Allows the user to retrieve specific attributes on the underlying implementation.

getErrorListener()

Retrieves the current error event handler (which should never be NULL) for the TransformerFactory.

getFeature()

Looks up the value of a feature.

getURIResolver()

Retrieves the object used by default during the transformation to resolve URIs.

newTemplates()

Processes the Source into a Templates object, which is a compiled representation of the source.

newTemplatesHandler()

Retrieves a TemplatesHandler object that can process SAX ContentHandler events into a Templates object.

newTransformer()

Generates a new Transformer object.

newTransformerHandler()

Generates a TransformerHandler object.

newXMLFilter()

Creates an XMLFilter.

setAttribute()

Sets specific attributes on the underlying implementation.

setErrorListener()

Sets the error event listener for the TransformerFactory; this is used for the processing of transformation instructions and not for the transformation itself.

setURIResolver()

Sets an object to use by default during the transformation to resolve URIs used in xsl:import, or xsl:include.

JXSAXTransformerFactory()

Description

The default constructor.

Syntax

public  JXSAXTransformerFactory();

getAssociatedStylesheet()

Description

Retrieves the stylesheet specification(s) associated through the xml-stylesheet processing instruction (see http://www.w3.org/TR/xml-stylesheet/) matching the document specified in the source parameter and other parameters. Returns a Source object suitable for passing to the TransformerFactory. Note that it is possible to return several stylesheets, in which case they are applied as if they were a list of imports or cascades in a single stylesheet.

Syntax

public Source getAssociatedStylesheet( Source source,
                                       String media,
                                       String title,
                                       String charset);

Parameter Description

source

The XML source document.

media

The media attribute to be matched. May be NULL, in which case the preferred templates will be used (alternate = no).

title

The value of the title attribute to match. May be NULL.

charset

The value of the charset attribute to match. May be NULL.

getAttribute()

Description

Allows the user to retrieve specific attributes on the underlying implementation. Returns the value of the attribute. Throws IllegalArgumentException if the underlying implementation doesn't recognize the attribute.

Syntax

public java.lang.Object getAttribute( String name);

Parameter Description

name

The name of the attribute.

getErrorListener()

Description

Retrieves the current error event handler (which should never be NULL) for the TransformerFactory.

Syntax

public ErrorListener getErrorListener();

getFeature()

Description

Looks up the value of a feature. Returns the current state of the feature (TRUE or FALSE). The feature name is any absolute URI.

Syntax

public boolean getFeature( String name);

Parameter Description

name

The feature name, which is an absolute URI.

getURIResolver()

Description

Retrieves the object used by default during the transformation to resolve URIs used in document(), xsl:import(), or xsl:include(). Returns the URIResolver that was set with setURIResolver.

Syntax

public URIResolver getURIResolver();

newTemplates()

Description

Processes the Source into a Templates object, which is a compiled representation of the source. Returns a Templates object capable of being used for transformation purposes, never NULL. This Templates object may then be used concurrently across multiple threads. Creating a Templates object allows the TransformerFactory to do detailed performance optimization of transformation instructions, without penalizing runtime transformation. If the methods fails to construct the Templates object during the parse, it throws TransformerConfigurationException.

Syntax

public Templates newTemplates( Source source);

Parameter Description

source

An object that holds a URL, input stream, and so on.

newTemplatesHandler()

Description

Retrieves a TemplatesHandler object that can process SAX ContentHandler events into a Templates object. Returns a non-NULL reference to a TransformerHandler, that may be used as a ContentHandler for SAX parse events. If the TemplatesHandler cannot be created, throws a TransformerConfigurationException.

Syntax

public TemplatesHandler newTemplatesHandler();

newTransformer()

Description

Generates a new Transformer object. Returns a Transformer object that may be used to perform a transformation in a single thread, never NULL. Care must be taken not to use this object in multiple threads running concurrently; instead, different TransformerFactories should be used concurrently by different threads. Throws TransformerConfigurationException if construction of the Templates object fails during parse. The options are described in the following table.

Syntax Description

public Transformer newTransformer();

Creates a new Transformer object that performs a copy of the source to the result.

public Transformer newTransformer(

Source source);

Process the Source into a Transformer object.


Parameter Description

source

An object that holds a URI, input stream, and so on.

newTransformerHandler()

Description

Generates a TransformerHandler object. Returns a non-NULL reference to a TransformerHandler, ready to transform SAX parse events. The transformation is defined as an identity (or copy) transformation, for example to copy a series of SAX parse events into a DOM tree. If the TransformerHandler cannot be created, throws TransformerConfigurationException. The options are described in the following table.

Syntax Description

public TransformerHandler newTransformerHandler();

Generates a TransformerHandler object that can process SAX ContentHandler events into a Result.

public TransformerHandler newTransformerHandler( Source source);

Generates a TransformerHandler object that can process SAX ContentHandler events into a Result based on the transformation instructions specified by the source argument.

public TransformerHandler newTransformerHandler(

Templates templates);

Generates a TransformerHandler object that can process SAX ContentHandler events into a Result based on the transformation instructions specified by the templates argument.


Parameter Description

source

The Source of the transformation instructions.

templates

The compiled transformation instructions.

newXMLFilter()

Description

Creates an XMLFilter. Returns an XMLFilter object, or null if this feature is not supported. Throws TransformerConfigurationException if the TemplatesHandler cannot be created. The options are described in the following table.

Syntax Description

public XMLFilter newXMLFilter(

Source source);

Creates an XMLFilter that uses the given Source as the transformation instructions.

public XMLFilter newXMLFilter(

Templates templates);

Creates an XMLFilter that uses the given Templates as the transformation instructions.


Parameter Description

source

The Source of the transformation instructions.

templates

The compiled transformation instructions.

setAttribute()

Description

Sets specific attributes on the underlying implementation. An attribute in this context is defined to be an option that the implementation provides.

Syntax

public void setAttribute( String name, 
                          Object value);

Parameter Description

name

The name of the attribute.

value

The value of the attribute.

setErrorListener()

Description

Sets the error event listener for the TransformerFactory. This is used for the processing of transformation instructions, and not for the transformation itself. Throws IllegalArgumentException if listener is NULL.

Syntax

public void setErrorListener( 
               javax.xml.transform.ErrorListener listener);

Parameter Description

listener

The new error listener.

setURIResolver()

Description

Sets an object to use by default during the transformation to resolve URIs used in xsl:import, or xsl:include.

Syntax

public void setURIResolver( javax.xml.transform.URIResolver resolver);

Parameter Description

name

An object that implements the URIResolver interface, or NULL.


JXTransformer Class


Description of JXTransformer

An instance of this class can transform a source tree into a result tree.

An instance of this class can be obtained with the TransformerFactory.newTransformer method. This instance may then be used to process XML from a variety of sources and write the transformation output to a variety of sinks.

An object of this class may not be used in multiple threads running concurrently. Different Transformers may be used concurrently by different threads.

A Transformer may be used multiple times. Parameters and output properties are preserved across transformations.


Syntax of JXTransformer

public class JXTransformer
 
oracle.xml.jaxp.JXTransformer


Methods of JXTransformer

Table 3-7 Summary of Methods of JXTransformer  
Method Description

JXTransformer()

Constructs a JXTransformer object.

clearParameters()

Clears all parameters set with setParameter.

getErrorListener()

Retrieves the error event handler in effect for the transformation

getOutputProperties()

Retrieves a copy of the output properties for the transformation.

getOutputProperty()

Returns string value of an output property that is in effect for the transformation.

getParameter()

Returns a parameter that was explicitly set.

getURIResolver()

Returns an object that will be used to resolve URIs.

setErrorListener()

Sets the error event listener in effect for the transformation.

setOutputProperties()

Sets output properties for the transformation

setOutputProperty()

Sets an output property that will be in effect for the transformation.

setParameter()

Adds a parameter for the transformation.

setURIResolver()

Sets an object that will be used to resolve URIs used in document().

transform()

Processes the source tree to the output result.

JXTransformer()

Description

Constructs a JXTransformer object. The options are described in the following table.

Syntax Description

public JXTransformer();

Default constructor.

public JXTransformer(

oracle.xml.parser.v2.XSLStylesheet templates);

Constructs a JXTransformer object that uses the XSLStylesheet to transform the source.


Parameter Description

templates

An XSLStylesheet or Templates.

clearParameters()

Description

Clears all parameters set with setParameter.

Syntax

public void clearParameters();

getErrorListener()

Description

Retrieves the error event handler in effect for the transformation; the error handler should never be NULL.

Syntax

public javax.xml.transform.ErrorListener getErrorListener();

getOutputProperties()

Description

Retrieves a copy of the output properties for the transformation.

The properties returned should contain properties set by the user and properties set by the stylesheet. These properties are "defaulted" by default properties specified by section 16 of the XSL Transformations (XSLT) W3C Recommendation. The properties that were specifically set by the user or the stylesheet should be in the base Properties list, while the XSLT default properties that were not specifically set should be the default Properties list. Thus, getOutputProperties().getProperty() will obtain any property in that was set by setOutputProperty() , setOutputProperties() , in the stylesheet, or the default properties, while getOutputProperties().get() will only retrieve properties that were explicitly set by setOutputProperty() , setOutputProperties() , or in the stylesheet. Note that mutation of the Properties object returned will not effect the properties that the transformation contains.

If any of the argument keys are not recognized and are not namespace qualified, the property will be ignored; the behavior is not orthogonal with setOutputProperties().

Syntax

public java.util.Properties getOutputProperties();

getOutputProperty()

Description

Returns string value of an output property that is in effect for the transformation, or NULL if no property was found. The property specified may be a property that was set with setOutputProperty, or it may be a property specified in the stylesheet. Throws IllegalArgumentException if the property is not supported

Syntax

public String getOutputProperty( String name);

Parameter Description

name

A non-null String that specifies an output property name, which may be namespace qualified.

getParameter()

Description

Returns a parameter that was explicitly set with setParameter() or setParameters(); NULL if a parameter with the given name was not found. This method does not return a default parameter value, which cannot be determined until the node context is evaluated during the transformation process.

Syntax

public Object getParameter( String name);

Parameter Description

name

Parameter name.

getURIResolver()

Description

Returns an object that will be used to resolve URIs used in document(), and so on. Retrieves an object that implements the URIResolver interface, or null. Throws and IllegalArgumentException if listener is null.

Syntax

public javax.xml.transform.URIResolver getURIResolver();

setErrorListener()

Description

Sets the error event listener in effect for the transformation.

Syntax

public void setErrorListener(javax.xml.transform.ErrorListener listener)

Parameter Description

listener

The new error listener.

setOutputProperties()

Description

Sets the output properties for the transformation. These properties will override properties set in the Templates with xsl:output. Throws an IllegalArgumentException if any of the argument keys are not recognized and are not namespace qualified.

If argument to this function is null, any properties previously set are removed, and the value will revert to the value defined in the templates object.

Passes a qualified property key name as a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If the name has a null URL, the String only contain the local name. An application can safely check for a non-null URI by testing to see if the first character of the name is a '{' character.

For example, if a URI and local name were obtained from an element defined with <xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>, then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that no prefix is used.

Syntax

public void setOutputProperties( java.util.Properties oformat);

Parameter Description

oformat

A set of output properties that will be used to override any of the same properties in affect for the transformation.

setOutputProperty()

Description

Sets an output property that will be in effect for the transformation. Passes a qualified property name as a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If the name has a null URL, the String only contain the local name. An application can safely check for a non-null URI by testing to see if the first character of the name is a '{' character.

For example, if a URI and local name were obtained from an element defined with <xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>, then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that no prefix is used.

The Properties object that was passed to setOutputProperties(Properties)  won't be effected by calling this method.

Throws an IllegalArgumentException if the property is not supported, and is not qualified with a namespace.

Syntax

public void setOutputProperty(java.lang.String name, java.lang.String value)

Parameter Description

name

A non-null String that specifies an output property name, which may be namespace qualified.

value

The non-null string value of the output property.

setParameter()

Description

Adds a parameter for the transformation. Passes a qualified name as a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If the name has a null URL, the String only contains the local name. An application can safely check for a non-null URI by testing to see if the first character of the name is a '{' character.

For example, if a URI and local name were obtained from an element defined with <xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>, then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that no prefix is used.

Syntax

public void setParameter( String name, 
                          Object value);

Parameter Description

name

The name of the parameter, which may begin with a namespace URI in curly braces ({}).

value

The value object. This can be any valid Java object. It is up to the processor to provide the proper object coercion or to simply pass the object on for use in an extension.

setURIResolver()

Description

Sets an object that will be used to resolve URIs used in document(). If the resolver argument is null, the URIResolver value will be cleared, and the default behavior will be used. Currently, URIResolver in document() function is not supported.

Syntax

public void setURIResolver( javax.xml.transform.URIResolver resolver);

Parameter Description

resolver

An object that implements the URIResolver interface, or NULL.

transform()

Description

Processes the source tree to the output result. Throws TransformerException if an unrecoverable error occurs during the course of the transformation

Syntax

public void transform( javax.xml.transform.Source xmlSource,
                       javax.xml.transform.Result outputTarget);

Parameter Description

xmlSource

The input for the source tree.

outputTarget

The output target.


Go to previous page Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback