org.apache.xalan.xslt
Class XSLTInputSource

java.lang.Object
  |
  +--org.apache.xalan.xslt.XSLTInputSource

public class XSLTInputSource
extends java.lang.Object

Represents an XML source document or XSL stylesheet. Use XSLTInputSource objects to provide input to the XSLTProcessor process() method for a transformation. This class extends the SAX input source to handle DOM nodes as input as well as files, character streams, byte streams and SAX DocumentHandlers.

See Also:
XSLTProcessor.process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)

Constructor Summary
XSLTInputSource()
          Zero-argument default constructor -- Before you can use the new XSLTInputSource object in a transformation, you must define the document source with setSystemId().
XSLTInputSource(org.xml.sax.InputSource isource)
          Create a new XSLTInputSource source from a SAX input source.
XSLTInputSource(java.io.InputStream byteStream)
          Create a new input source with a byte stream.
XSLTInputSource(org.w3c.dom.Node node)
          Create a new input source with a DOM Node -- the equivalent of creating an input source with the zero-argument constructor and setting the new object's Node property.
XSLTInputSource(java.io.Reader characterStream)
          Create a new input source with a character stream -- the equivalent of creating an input source with the zero-argument constructor and setting the new object's CharacterStream property.
XSLTInputSource(java.lang.String systemId)
          Create a new input source with a system identifier (for a URL or file name) -- the equivalent of creating an input source with the zero-argument constructor and setting the new object's SystemId property.
 
Method Summary
 java.lang.String getEncoding()
          Get the character encoding for a byte stream or URI.
 javax.xml.transform.Source getSourceObject()
          Get the Result object associated with this XSLTResultTarget object .
 java.lang.String getSystemId()
          Get the base ID (URL or system ID) from where URLs will be resolved.
 void setEncoding(java.lang.String encoding)
          Set the DOM Node for this input source.
 void setSystemId(java.lang.String baseID)
          Set the character stream for this input source.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLTInputSource

public XSLTInputSource()
Zero-argument default constructor -- Before you can use the new XSLTInputSource object in a transformation, you must define the document source with setSystemId().
See Also:
setSystemId(String), setEncoding(String)

XSLTInputSource

public XSLTInputSource(java.lang.String systemId)
Create a new input source with a system identifier (for a URL or file name) -- the equivalent of creating an input source with the zero-argument constructor and setting the new object's SystemId property. If the system identifier is a URL, it must be fully resolved.
Parameters:
systemId - The system identifier (URI).
See Also:
setSystemId(String), setEncoding(String)

XSLTInputSource

public XSLTInputSource(java.io.InputStream byteStream)
Create a new input source with a byte stream.
Parameters:
byteStream - The raw byte stream containing the document.
See Also:
setSystemId(String), setEncoding(String)

XSLTInputSource

public XSLTInputSource(java.io.Reader characterStream)
Create a new input source with a character stream -- the equivalent of creating an input source with the zero-argument constructor and setting the new object's CharacterStream property.

The character stream shall not include a byte order mark.

Parameters:
characterStream - The character stream containing the document.
See Also:
setSystemId(String), setEncoding(String)

XSLTInputSource

public XSLTInputSource(org.w3c.dom.Node node)
Create a new input source with a DOM Node -- the equivalent of creating an input source with the zero-argument constructor and setting the new object's Node property.
Parameters:
node - The DOM Node containing the document.
See Also:
setSystemId(String)

XSLTInputSource

public XSLTInputSource(org.xml.sax.InputSource isource)
Create a new XSLTInputSource source from a SAX input source. This operation sets the ByteStream, CharacterStream, SystemId, PublicID, and Encoding properties.
Parameters:
isource - The SAX input source.
See Also:
setSystemId(String), setEncoding(String)
Method Detail

setEncoding

public void setEncoding(java.lang.String encoding)
Set the DOM Node for this input source.
Parameters:
characterStream - The character stream containing the XML document or XSL stylesheet.
encoding - A string describing the character encoding.
Returns:
The DOM node containing the document, or null if none was supplied.
See Also:
XSLTInputSource(Node), public void setNode (Node node) { this.node = node; } /** Get the DOM Node for this input source., public Node getNode () { return node; } private Node node = null; /** Set the character encoding, if known.

The encoding must be a string acceptable for an XML encoding declaration (see section 4.3.3 of the XML 1.0 recommendation).

This method has no effect when the application provides a character stream.

, setSystemId(java.lang.String), getEncoding()

getEncoding

public java.lang.String getEncoding()
Get the character encoding for a byte stream or URI.
Returns:
The encoding, or null if none was supplied.
See Also:
getSystemId()

setSystemId

public void setSystemId(java.lang.String baseID)
Set the character stream for this input source.

If there is a character stream specified, the SAX parser will ignore any byte stream and will not attempt to open a URI connection to the system identifier.

Parameters:
characterStream - The character stream containing the XML document or other entity.
baseID - Base URL for this.
Returns:
The character stream, or null if none was supplied. public Reader getCharacterStream () { return characterStream; } private Reader characterStream = null; /** Set the base ID (URL or system ID) from where URLs will be resolved.
See Also:
public void setCharacterStream (Reader characterStream) { this.characterStream = characterStream; } /** Get the character stream for this input source.

getSystemId

public java.lang.String getSystemId()
Get the base ID (URL or system ID) from where URLs will be resolved.
Returns:
Base URL for this.

getSourceObject

public javax.xml.transform.Source getSourceObject()
Get the Result object associated with this XSLTResultTarget object .
Returns:
The Result object associated with this XSLTResultTarget object


Copyright © 2000 Apache XML Project. All Rights Reserved.