Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
287
The javax.xml.transform.stream.StreamSource Class
All implemented Interface: javax.xml.transform.Source
Members
Signature
Public methods
InputStream
getInputStream()
String
getPublicId()
Reader
getReader()
String
getSystemId()
void
setInputStream(InputStream
inputStream)
void
setPublicId(String
publicId)
void
setReader(Reader
reader)
void
setSystemId(File
f)
void
setSystemId(String
systemId)
Overview
This
class reads input from some type of I/O device. Constructors are provided for
accepting an InputStream, a Reader, or a String system ID as input. Once
created, the StreamSource can be passed to the Transformer for use. It is
capable of reading a document from a network, input stream, user input, or
other static representation of XSL stylesheets.
Method Overviews
Almost
all methods in this class are important. It depends upon, how user is going to
implement it. The settter methods are
used to set input stream, system id, File, or Reader from where the
StreamSource can read the input.
Example of setSystemId(String systemId)
setSystemId() method is used to set the system identifier for this
Source.
The system identifier is optional if the source does not get its data
from a URL, but it may still be useful to provide one. The application can use
a system identifier, for example, to resolve relative URIs and to include in
error messages and warnings.
StreamSource
Source source = new StreamSource();
source.setSystemId(systemURI);//Where
systemId would be The system identifier as a URI string.
Example of setSystemId(File f)
setSystemId(File f) method is used to set the system
identifier from File reference. So StreamSource can read the input from the
referred File.
StreamSource Source source = new
StreamSource();
Java.io.File inputFile = new
java.io.File({file uri});