InputStream stream = null; String encoding = source.getEncoding(); if (encoding == null) { encoding = "UTF-8";
/** * Pushes an input source onto the current entity stack. This enables the scanner to * transparently scan new content (e.g. the output written by an embedded script). At the end of * the current entity, the scanner returns where it left off at the time this entity source was * pushed. * <p> * <strong>Note:</strong> This functionality is experimental at this time and is subject to * change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
/** * Pushes an input source onto the current entity stack. This enables the scanner to * transparently scan new content (e.g. the output written by an embedded script). At the end of * the current entity, the scanner returns where it left off at the time this entity source was * pushed. * <p> * <strong>Note:</strong> This functionality is experimental at this time and is subject to * change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
/** * Pushes an input source onto the current entity stack. This * enables the scanner to transparently scan new content (e.g. * the output written by an embedded script). At the end of the * current entity, the scanner returns where it left off at the * time this entity source was pushed. * <p> * <strong>Note:</strong> * This functionality is experimental at this time and is * subject to change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); final String encoding = inputSource.getEncoding(); final String publicId = inputSource.getPublicId(); final String baseSystemId = inputSource.getBaseSystemId(); final String literalSystemId = inputSource.getSystemId(); final String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); }
/** * Pushes an input source onto the current entity stack. This * enables the scanner to transparently scan new content (e.g. * the output written by an embedded script). At the end of the * current entity, the scanner returns where it left off at the * time this entity source was pushed. * <p> * <strong>Note:</strong> * This functionality is experimental at this time and is * subject to change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
/** * Pushes an input source onto the current entity stack. This * enables the scanner to transparently scan new content (e.g. * the output written by an embedded script). At the end of the * current entity, the scanner returns where it left off at the * time this entity source was pushed. * <p> * <strong>Note:</strong> * This functionality is experimental at this time and is * subject to change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
String encoding = source.getEncoding(); String publicId = source.getPublicId(); String baseSystemId = source.getBaseSystemId();
@Override public void resolve(Identifier id, Input input) throws IOException, ResolverException { if(fResolver != null) { String expanded = id.getUriReference(); //Compute the expanded system ID try { expanded = new URL(new URL(id.getBase()), id.getUriReference()).toString(); } catch (Exception e) { } XMLResourceIdentifier identifier = new XMLResourceIdentifierImpl( null, id.getUriReference(), id.getBase(), expanded); XMLInputSource resolved = fResolver.resolveEntity(identifier); if(resolved != null) { input.setUri(resolved.getSystemId()); input.setByteStream(resolved.getByteStream()); input.setCharacterStream(resolved.getCharacterStream()); input.setEncoding(resolved.getEncoding()); } else { //Just set the URI //input.setUri(expanded); } } } /**
String literalSystemId = xmlInputSource.getSystemId(); String baseSystemId = xmlInputSource.getBaseSystemId(); String encoding = xmlInputSource.getEncoding(); final boolean encodingExternallySpecified = (encoding != null); Boolean isBigEndian = null;
String encoding = source.getEncoding(); String publicId = source.getPublicId(); String baseSystemId = source.getBaseSystemId();
String encoding = source.getEncoding(); final String publicId = source.getPublicId(); final String baseSystemId = source.getBaseSystemId();
String encoding = source.getEncoding(); String publicId = source.getPublicId(); String baseSystemId = source.getBaseSystemId();
String encoding = source.getEncoding(); String publicId = source.getPublicId(); String baseSystemId = source.getBaseSystemId();
final Reader reader = getReader(inputSource); final String encoding = inputSource.getEncoding(); final String publicId = inputSource.getPublicId(); final String baseSystemId = inputSource.getBaseSystemId();
final Reader reader = getReader(inputSource); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId();
final Reader reader = getReader(inputSource); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId();
final Reader reader = getReader(inputSource); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId();
final Reader reader = getReader(inputSource); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId();
public LSInput resolveResource(String type,String ns, String publicId, String systemId, String baseUri) { if(fEntityResolver==null) return null; try { XMLInputSource is = fEntityResolver.resolveEntity( new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null)); if(is==null) return null; LSInput di = new DOMInputImpl(); di.setBaseURI(is.getBaseSystemId()); di.setByteStream(is.getByteStream()); di.setCharacterStream(is.getCharacterStream()); di.setEncoding(is.getEncoding()); di.setPublicId(is.getPublicId()); di.setSystemId(is.getSystemId()); return di; } catch( IOException e ) { // erors thrown by the callback is not supposed to be // reported to users. throw new XNIException(e); } } });