org.apache.xerces.xni.parser

Class XMLInputSource

Known Direct Subclasses:
DOMInputSource, HTTPInputSource, SAXInputSource

public class XMLInputSource
extends Object

This class represents an input source for an XML document. The basic properties of an input source are the following:

Field Summary

protected String
fBaseSystemId
Base system identifier.
protected InputStream
fByteStream
Byte stream.
protected Reader
fCharStream
Character stream.
protected String
fEncoding
Encoding.
protected String
fPublicId
Public identifier.
protected String
fSystemId
System identifier.

Constructor Summary

XMLInputSource(String publicId, String systemId, String baseSystemId)
Constructs an input source from just the public and system identifiers, leaving resolution of the entity and opening of the input stream up to the caller.
XMLInputSource(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding)
Constructs an input source from a byte stream.
XMLInputSource(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding)
Constructs an input source from a character stream.
XMLInputSource(XMLResourceIdentifier resourceIdentifier)
Constructs an input source from a XMLResourceIdentifier object, leaving resolution of the entity and opening of the input stream up to the caller.

Method Summary

String
getBaseSystemId()
Returns the base system identifier.
InputStream
getByteStream()
Returns the byte stream.
Reader
getCharacterStream()
Returns the character stream.
String
getEncoding()
Returns the encoding of the stream, or null if not known.
String
getPublicId()
Returns the public identifier.
String
getSystemId()
Returns the system identifier.
void
setBaseSystemId(String baseSystemId)
Sets the base system identifier.
void
setByteStream(InputStream byteStream)
Sets the byte stream.
void
setCharacterStream(Reader charStream)
Sets the character stream.
void
setEncoding(String encoding)
Sets the encoding of the stream.
void
setPublicId(String publicId)
Sets the public identifier.
void
setSystemId(String systemId)
Sets the system identifier.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

fBaseSystemId

protected String fBaseSystemId
Base system identifier.

fByteStream

protected InputStream fByteStream
Byte stream.

fCharStream

protected Reader fCharStream
Character stream.

fEncoding

protected String fEncoding
Encoding.

fPublicId

protected String fPublicId
Public identifier.

fSystemId

protected String fSystemId
System identifier.

Constructor Details

XMLInputSource

public XMLInputSource(String publicId,
                      String systemId,
                      String baseSystemId)
Constructs an input source from just the public and system identifiers, leaving resolution of the entity and opening of the input stream up to the caller.
Parameters:
publicId - The public identifier, if known.
systemId - The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
baseSystemId - The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
Usages and Demos :

View More Examples of XMLInputSource(String publicId,String systemId,String baseSystemId)
   1:             XMLInputSource is = 
   2:                 new XMLInputSource(null, args[0], null);
   3:             XMLPullParser pullParser = new Xerces2();
   4:             pullParser.setInputSource(is);
   5:             Book book = makeBook(pullParser);

View Full Code Here
   1:                     XMLGrammarDescription.XML_SCHEMA,
   2:                     new XMLInputSource(null, "book.xsd", null));
   3:         } catch (XNIException xe) {
   4:             xe.printStackTrace();
   5:         } catch (IOException ioe) {

View Full Code Here
   1:                               throws DOMASException, Exception {
   2:         XMLInputSource source = new XMLInputSource(null, uri, null);
   3:         return parseASInputSource(source);
   4:     }

View Full Code Here
   1:             fGrammarPool.clear();
   2:             return ((XSGrammar) fSchemaLoader.loadGrammar(new XMLInputSource(null, uri, null))).toXSModel();
   3:         }
   4:         catch (Exception e){
   5:             fSchemaLoader.reportDOMFatalError(e);

View Full Code Here

XMLInputSource

public XMLInputSource(String publicId,
                      String systemId,
                      String baseSystemId,
                      InputStream byteStream,
                      String encoding)
Constructs an input source from a byte stream.
Parameters:
publicId - The public identifier, if known.
systemId - The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
baseSystemId - The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
byteStream - The byte stream.
encoding - The encoding of the byte stream, if known.
Usages and Demos :

View More Examples of XMLInputSource(String publicId,String systemId,String baseSystemId,InputStream byteStream,String encoding)
   1:       XMLGrammarDescription.XML_SCHEMA,
   2:       new XMLInputSource(null, systemId, null, is, null));
   3:   }
   4: 
   5:   public void testParseValidating() throws Exception {

View Full Code Here
   1:         {
   2:             parser.parse(new XMLInputSource( null, null, null, reader, null )) ;
   3:         }
   4:         catch (IOException e)
   5:         {

View Full Code Here
   1:           InputStream is = source.getInputStream();
   2:           parser.setInputSource(new XMLInputSource(null, src, null, is, null));
   3:         } catch (SourceNotFoundException e) {
   4:           getLogger().warn("Source '"+source+"' not found");
   5:           return null;

View Full Code Here
   1:           InputStream is = source.getInputStream();
   2:           parser.setInputSource(new XMLInputSource(null, src, null, is, null));
   3:         } catch (SourceNotFoundException e) {
   4:           getLogger().warn("Source '"+source+"' not found");
   5:           return null;

View Full Code Here
   1:             FileReader fr = new FileReader(new File(docfiles[i]));
   2:             XMLInputSource inputSource = new XMLInputSource(null, null, null, fr, null);
   3:             parsers[i] = new XML11Configuration();
   4:             parsers[i].setInputSource(inputSource);
   5:             positions[i] = 0;

View Full Code Here

XMLInputSource

public XMLInputSource(String publicId,
                      String systemId,
                      String baseSystemId,
                      Reader charStream,
                      String encoding)
Constructs an input source from a character stream.
Parameters:
publicId - The public identifier, if known.
systemId - The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
baseSystemId - The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
charStream - The character stream.
encoding - The original encoding of the byte stream used by the reader, if known.
Usages and Demos :

View More Examples of XMLInputSource(String publicId,String systemId,String baseSystemId,Reader charStream,String encoding)
   1:       XMLGrammarDescription.XML_SCHEMA,
   2:       new XMLInputSource(null, systemId, null, is, null));
   3:   }
   4: 
   5:   public void testParseValidating() throws Exception {

View Full Code Here
   1:         {
   2:             parser.parse(new XMLInputSource( null, null, null, reader, null )) ;
   3:         }
   4:         catch (IOException e)
   5:         {

View Full Code Here
   1:           InputStream is = source.getInputStream();
   2:           parser.setInputSource(new XMLInputSource(null, src, null, is, null));
   3:         } catch (SourceNotFoundException e) {
   4:           getLogger().warn("Source '"+source+"' not found");
   5:           return null;

View Full Code Here
   1:           InputStream is = source.getInputStream();
   2:           parser.setInputSource(new XMLInputSource(null, src, null, is, null));
   3:         } catch (SourceNotFoundException e) {
   4:           getLogger().warn("Source '"+source+"' not found");
   5:           return null;

View Full Code Here
   1:             FileReader fr = new FileReader(new File(docfiles[i]));
   2:             XMLInputSource inputSource = new XMLInputSource(null, null, null, fr, null);
   3:             parsers[i] = new XML11Configuration();
   4:             parsers[i].setInputSource(inputSource);
   5:             positions[i] = 0;

View Full Code Here

XMLInputSource

public XMLInputSource(XMLResourceIdentifier resourceIdentifier)
Constructs an input source from a XMLResourceIdentifier object, leaving resolution of the entity and opening of the input stream up to the caller.
Parameters:
resourceIdentifier - the XMLResourceIdentifier containing the information
Usages and Demos :

View More Examples of XMLInputSource(XMLResourceIdentifier resourceIdentifier)
   1:   private static XMLInputSource toXMLInputSource(InputSource in) {
   2:     XMLInputSource xin = new XMLInputSource(in.getPublicId(), in.getSystemId(), null);
   3:     xin.setByteStream(in.getByteStream());
   4:     xin.setCharacterStream(in.getCharacterStream());
   5:     xin.setEncoding(in.getEncoding());

View Full Code Here
   1:       InputStream byteStream = inputSource.getByteStream();
   2:       return new XMLInputSource(resId.getPublicId(), resId.getExpandedSystemId(), resId.getBaseSystemId(), byteStream, encoding);
   3:    }
   4: }

View Full Code Here
   1:             final StreamSource streamSource = (StreamSource) source;
   2:             XMLInputSource input = new XMLInputSource(streamSource.getPublicId(), streamSource.getSystemId(), null);
   3:             input.setByteStream(streamSource.getInputStream());
   4:             input.setCharacterStream(streamSource.getReader());
   5:             

View Full Code Here
   1:             XMLInputSource xmlInputSource =
   2:                 new XMLInputSource(inputSource.getPublicId(),
   3:                                    inputSource.getSystemId(),
   4:                                    null);
   5:             xmlInputSource.setByteStream(inputSource.getByteStream());

View Full Code Here
   1:         if (resolvedId != null) {
   2:             return new XMLInputSource(resourceIdentifier.getPublicId(), 
   3:                                       resolvedId, 
   4:                                       resourceIdentifier.getBaseSystemId());
   5:         }

View Full Code Here

Method Details

getBaseSystemId

public String getBaseSystemId()
Returns the base system identifier.
Usages and Demos :

View More Examples of getBaseSystemId()
   1: import org.apache.xerces.xni.XMLResourceIdentifier;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5:         this.setValues(id.getPublicId(), id.getLiteralSystemId(),
   6:                 id.getBaseSystemId(), id.getExpandedSystemId());
   7:         this.fRootName = rootName;
   8:         ...
   9: 
  10:     public XMLDTDDescription(XMLInputSource source) {
  11:         this.setValues(source.getPublicId(), null,
  12:         ...
  13:                 source.getBaseSystemId(), source.getSystemId());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.w3c.dom.TypeInfo;
   4:         ...
   5:                 try {
   6:                     XMLInputSource is = fEntityResolver.resolveEntity(
   7:                         new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
   8:         ...
   9:                     LSInput di = new DOMInputImpl();
  10:                     di.setBaseURI(is.getBaseSystemId());
  11:                     di.setByteStream(is.getByteStream());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParserConfiguration;
   4:         ...
   5: 
   6:         XMLInputSource includedSource = null;
   7:         if (fEntityResolver != null) {
   8:         ...
   9:                     includedSource = createInputSource(includedSource.getPublicId(), includedSource.getSystemId(), 
  10:                         includedSource.getBaseSystemId(), accept, acceptLanguage);
  11:                 }
  12:         ...
  13:             else {
  14:                 includedSource = new XMLInputSource(null, href, fCurrentBaseURI.getExpandedSystemId());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xs.XSObject;
   4:         ...
   5:     
   6:     public SchemaGrammar parseSchema(XMLInputSource is, XSDDescription desc,
   7:             Hashtable locationPairs)
   8:         ...
   9:                 return grammar;
  10:             String schemaId = XMLEntityManager.expandSystemId(is.getSystemId(), is.getBaseSystemId(), false);
  11:             XSDKey key = new XSDKey(schemaId, referType, schemaNamespace);
  12:         ...
  13:             try {
  14:                 return sg.getDocumentLocations().contains(XMLEntityManager.expandSystemId(desc.getLiteralSystemId(), desc.getBaseSystemId(), false));

View Full Code Here

getByteStream

public InputStream getByteStream()
Returns the byte stream.
Usages and Demos :

View More Examples of getByteStream()
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.w3c.dom.TypeInfo;
   4:         ...
   5:                 try {
   6:                     XMLInputSource is = fEntityResolver.resolveEntity(
   7:                         new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
   8:         ...
   9:                     di.setBaseURI(is.getBaseSystemId());
  10:                     di.setByteStream(is.getByteStream());
  11:                     di.setCharacterStream(is.getCharacterStream());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParserConfiguration;
   4:         ...
   5: 
   6:         XMLInputSource includedSource = null;
   7:         if (fEntityResolver != null) {
   8:         ...
   9:                     includedSource.getCharacterStream() == null &&
  10:                     includedSource.getByteStream() == null) {
  11:                     
  12:         ...
  13:             else {
  14:                 includedSource = new XMLInputSource(null, href, fCurrentBaseURI.getExpandedSystemId());

View Full Code Here

getCharacterStream

public Reader getCharacterStream()
Returns the character stream.
Usages and Demos :

View More Examples of getCharacterStream()
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.w3c.dom.TypeInfo;
   4:         ...
   5:                 try {
   6:                     XMLInputSource is = fEntityResolver.resolveEntity(
   7:                         new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
   8:         ...
   9:                     di.setByteStream(is.getByteStream());
  10:                     di.setCharacterStream(is.getCharacterStream());
  11:                     di.setEncoding(is.getEncoding());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParserConfiguration;
   4:         ...
   5: 
   6:         XMLInputSource includedSource = null;
   7:         if (fEntityResolver != null) {
   8:         ...
   9:                     (accept != null || acceptLanguage != null) &&
  10:                     includedSource.getCharacterStream() == null &&
  11:                     includedSource.getByteStream() == null) {
  12:         ...
  13:             else {
  14:                 includedSource = new XMLInputSource(null, href, fCurrentBaseURI.getExpandedSystemId());

View Full Code Here

getEncoding

public String getEncoding()
Returns the encoding of the stream, or null if not known.
Usages and Demos :

View More Examples of getEncoding()
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.w3c.dom.TypeInfo;
   4:         ...
   5:                 try {
   6:                     XMLInputSource is = fEntityResolver.resolveEntity(
   7:                         new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
   8:         ...
   9:                     di.setCharacterStream(is.getCharacterStream());
  10:                     di.setEncoding(is.getEncoding());
  11:                     di.setPublicId(is.getPublicId());

View Full Code Here

getPublicId

public String getPublicId()
Returns the public identifier.
Usages and Demos :

View More Examples of getPublicId()
   1: import org.apache.xerces.xni.XMLResourceIdentifier;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5:     public XMLDTDDescription(XMLResourceIdentifier id, String rootName) {
   6:         this.setValues(id.getPublicId(), id.getLiteralSystemId(),
   7:                 id.getBaseSystemId(), id.getExpandedSystemId());
   8:         ...
   9: 
  10:     public XMLDTDDescription(XMLInputSource source) {
  11:         ...
  12:         this.setValues(source.getPublicId(), null,

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.w3c.dom.TypeInfo;
   4:         ...
   5:                 try {
   6:                     XMLInputSource is = fEntityResolver.resolveEntity(
   7:                         new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
   8:         ...
   9:                     di.setEncoding(is.getEncoding());
  10:                     di.setPublicId(is.getPublicId());
  11:                     di.setSystemId(is.getSystemId());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
   7:             throws IOException, XNIException {
   8:         ...
   9:         if(resourceIdentifier == null ) return null;
  10:         String publicId = resourceIdentifier.getPublicId();
  11:         String literalSystemId = resourceIdentifier.getLiteralSystemId();
  12:         ...
  13: 
  14:         XMLInputSource xmlInputSource = null;

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParserConfiguration;
   4:         ...
   5: 
   6:         XMLInputSource includedSource = null;
   7:         if (fEntityResolver != null) {
   8:         ...
   9:                     
  10:                     includedSource = createInputSource(includedSource.getPublicId(), includedSource.getSystemId(), 
  11:                         includedSource.getBaseSystemId(), accept, acceptLanguage);
  12:         ...
  13:             else {
  14:                 includedSource = new XMLInputSource(null, href, fCurrentBaseURI.getExpandedSystemId());

View Full Code Here

getSystemId

public String getSystemId()
Returns the system identifier.
Usages and Demos :

View More Examples of getSystemId()
   1: import org.apache.xerces.xni.XMLResourceIdentifier;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLDTDDescription(XMLInputSource source) {
   7:         this.setValues(source.getPublicId(), null,
   8:         ...
   9:                 source.getBaseSystemId(), source.getSystemId());
  10:         this.fRootName = null;

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.w3c.dom.TypeInfo;
   4:         ...
   5:                 try {
   6:                     XMLInputSource is = fEntityResolver.resolveEntity(
   7:                         new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
   8:         ...
   9:                     di.setPublicId(is.getPublicId());
  10:                     di.setSystemId(is.getSystemId());
  11:                         

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParserConfiguration;
   4:         ...
   5: 
   6:         XMLInputSource includedSource = null;
   7:         if (fEntityResolver != null) {
   8:         ...
   9:                     
  10:                     includedSource = createInputSource(includedSource.getPublicId(), includedSource.getSystemId(), 
  11:                         includedSource.getBaseSystemId(), accept, acceptLanguage);
  12:         ...
  13:             else {
  14:                 includedSource = new XMLInputSource(null, href, fCurrentBaseURI.getExpandedSystemId());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLErrorHandler;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xs.XSObject;
   4:         ...
   5:     
   6:     public SchemaGrammar parseSchema(XMLInputSource is, XSDDescription desc,
   7:             Hashtable locationPairs)
   8:         ...
   9:                 return grammar;
  10:             String schemaId = XMLEntityManager.expandSystemId(is.getSystemId(), is.getBaseSystemId(), false);
  11:             XSDKey key = new XSDKey(schemaId, referType, schemaNamespace);
  12:         ...
  13:         
  14:         fRoot = constructTrees(schemaRoot, is.getSystemId(), desc);

View Full Code Here

setBaseSystemId

public void setBaseSystemId(String baseSystemId)
Sets the base system identifier.
Parameters:
baseSystemId - The new base system identifier.

setByteStream

public void setByteStream(InputStream byteStream)
Sets the byte stream. If the byte stream is not already opened when this object is instantiated, then the code that opens the stream should also set the byte stream on this object. Also, if the encoding is auto-detected, then the encoding should also be set on this object.
Parameters:
byteStream - The new byte stream.
Usages and Demos :

View More Examples of setByteStream(InputStream byteStream)
   1: import org.apache.xerces.xni.grammars.XMLGrammarPool;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.xml.sax.ErrorHandler;
   4:         ...
   5: 
   6:   private static XMLInputSource toXMLInputSource(InputSource in) {
   7:         ...
   8:     XMLInputSource xin = new XMLInputSource(in.getPublicId(), in.getSystemId(), null);
   9:         ...
  10:     xin.setByteStream(in.getByteStream());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
   7:         throws XNIException, IOException {
   8:         ...
   9:                     String encoding = inputSource.getEncoding();
  10:                     XMLInputSource xmlInputSource =
  11:                         new XMLInputSource(publicId, systemId, baseSystemId);
  12:         ...
  13:                     xmlInputSource.setByteStream(byteStream);

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
   7:         throws XNIException, IOException {
   8:         ...
   9: 
  10:                 XMLInputSource xmlInputSource =
  11:                     new XMLInputSource(publicId, systemId, baseSystemId);
  12:         ...
  13:                 else if (byteStream != null) {
  14:                     xmlInputSource.setByteStream((InputStream) byteStream);

View Full Code Here
   1: import org.apache.xerces.xni.XNIException;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParseException;
   4:         ...
   5:             final StreamSource streamSource = (StreamSource) source;
   6:             XMLInputSource input = new XMLInputSource(streamSource.getPublicId(), streamSource.getSystemId(), null);
   7:         ...
   8:             input.setByteStream(streamSource.getInputStream());
   9:             input.setCharacterStream(streamSource.getReader());

View Full Code Here
   1: import org.apache.xerces.xni.grammars.XMLDTDDescription;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5:     
   6:     public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
   7:             throws XNIException, IOException {
   8:         ...
   9:     
  10:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
  11:             throws XNIException, IOException {
  12:         ...
  13:             new XMLInputSource(publicId, systemId, baseSystemId);
  14:         xmlInputSource.setByteStream(byteStream);

View Full Code Here

setCharacterStream

public void setCharacterStream(Reader charStream)
Sets the character stream. If the character stream is not already opened when this object is instantiated, then the code that opens the stream should also set the character stream on this object. Also, the encoding of the byte stream used by the reader should also be set on this object, if known.
Parameters:
charStream - The new character stream.
Usages and Demos :

View More Examples of setCharacterStream(Reader charStream)
   1: import org.apache.xerces.xni.grammars.XMLGrammarPool;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.xml.sax.ErrorHandler;
   4:         ...
   5: 
   6:   private static XMLInputSource toXMLInputSource(InputSource in) {
   7:         ...
   8:     XMLInputSource xin = new XMLInputSource(in.getPublicId(), in.getSystemId(), null);
   9:     xin.setByteStream(in.getByteStream());
  10:         ...
  11:     xin.setCharacterStream(in.getCharacterStream());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
   7:         throws XNIException, IOException {
   8:         ...
   9:                     String encoding = inputSource.getEncoding();
  10:                     XMLInputSource xmlInputSource =
  11:                         new XMLInputSource(publicId, systemId, baseSystemId);
  12:         ...
  13:                     xmlInputSource.setByteStream(byteStream);
  14:                     xmlInputSource.setCharacterStream(charStream);

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
   7:         throws XNIException, IOException {
   8:         ...
   9: 
  10:                 XMLInputSource xmlInputSource =
  11:                     new XMLInputSource(publicId, systemId, baseSystemId);
  12:         ...
  13:                 if (charStream != null) {
  14:                     xmlInputSource.setCharacterStream(charStream);

View Full Code Here
   1: import org.apache.xerces.xni.XNIException;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParseException;
   4:         ...
   5:             final StreamSource streamSource = (StreamSource) source;
   6:             XMLInputSource input = new XMLInputSource(streamSource.getPublicId(), streamSource.getSystemId(), null);
   7:             input.setByteStream(streamSource.getInputStream());
   8:         ...
   9:             input.setCharacterStream(streamSource.getReader());
  10:             

View Full Code Here
   1: import org.apache.xerces.xni.grammars.XMLDTDDescription;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5:     
   6:     public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
   7:             throws XNIException, IOException {
   8:         ...
   9:     
  10:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
  11:             throws XNIException, IOException {
  12:         ...
  13:         xmlInputSource.setByteStream(byteStream);
  14:         xmlInputSource.setCharacterStream(charStream);

View Full Code Here

setEncoding

public void setEncoding(String encoding)
Sets the encoding of the stream.
Parameters:
encoding - The new encoding.
Usages and Demos :

View More Examples of setEncoding(String encoding)
   1: import org.apache.xerces.xni.grammars.XMLGrammarPool;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.xml.sax.ErrorHandler;
   4:         ...
   5: 
   6:   private static XMLInputSource toXMLInputSource(InputSource in) {
   7:         ...
   8:     XMLInputSource xin = new XMLInputSource(in.getPublicId(), in.getSystemId(), null);
   9:     xin.setByteStream(in.getByteStream());
  10:         ...
  11:     xin.setCharacterStream(in.getCharacterStream());
  12:     xin.setEncoding(in.getEncoding());

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
   7:         throws XNIException, IOException {
   8:         ...
   9:                     String encoding = inputSource.getEncoding();
  10:                     XMLInputSource xmlInputSource =
  11:                         new XMLInputSource(publicId, systemId, baseSystemId);
  12:         ...
  13:                     xmlInputSource.setCharacterStream(charStream);
  14:                     xmlInputSource.setEncoding(encoding);

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5: 
   6:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
   7:         throws XNIException, IOException {
   8:         ...
   9: 
  10:                 XMLInputSource xmlInputSource =
  11:                     new XMLInputSource(publicId, systemId, baseSystemId);
  12:         ...
  13:                 }
  14:                 xmlInputSource.setEncoding(encoding);

View Full Code Here
   1: import org.apache.xerces.xni.grammars.XMLDTDDescription;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: 
   4:         ...
   5:     
   6:     public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
   7:             throws XNIException, IOException {
   8:         ...
   9:     
  10:     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
  11:             throws XNIException, IOException {
  12:         ...
  13:         xmlInputSource.setCharacterStream(charStream);
  14:         xmlInputSource.setEncoding(encoding);

View Full Code Here
   1: import org.apache.xerces.xni.parser.XMLEntityResolver;
   2: import org.apache.xerces.xni.parser.XMLInputSource;
   3: import org.apache.xerces.xni.parser.XMLParserConfiguration;
   4:         ...
   5: 
   6:         XMLInputSource includedSource = null;
   7:         if (fEntityResolver != null) {
   8:         ...
   9:             else {
  10:                 includedSource = new XMLInputSource(null, href, fCurrentBaseURI.getExpandedSystemId());
  11:             }
  12:         ...
  13:             String encoding = attributes.getValue(XINCLUDE_ATTR_ENCODING);
  14:             includedSource.setEncoding(encoding);

View Full Code Here

setPublicId

public void setPublicId(String publicId)
Sets the public identifier.
Parameters:
publicId - The new public identifier.

setSystemId

public void setSystemId(String systemId)
Sets the system identifier.
Parameters:
systemId - The new system identifier.