public String getEncoding() { return delegate.getEncoding(); }
@Override protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException { return transformAndUnmarshal(new SAXSource(xmlReader, inputSource), inputSource.getEncoding()); }
/** * Picks an encoding for an external entity. Defaults to UTF-8. */ private String pickEncoding(InputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader != null) { return CHARACTER_ENCODING; } String encoding = inputSource.getEncoding(); return encoding == null ? DEFAULT_ENCODING : encoding; }
parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa);
if (reader == null) { InputStream stream = source.getByteStream(); final String encoding = source.getEncoding();
String encoding = input.getEncoding(); if (in != null) { try {
String qualifiedName = null; DocumentType doctype = null; String inputEncoding = source.getEncoding(); String systemId = source.getSystemId(); DocumentImpl document = new DocumentImpl(
String inputEnc = input.getEncoding(); String publicId = input.getPublicId();
/** * Returns the encoding of the resource. * @return the encoding of the resource */ public String getEncoding() { return source.getEncoding(); }
/** * Picks an encoding for an external entity. Defaults to UTF-8. */ private String pickEncoding(InputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader != null) { return CHARACTER_ENCODING; } String encoding = inputSource.getEncoding(); return encoding == null ? DEFAULT_ENCODING : encoding; }
/** * Picks an encoding for an external entity. Defaults to UTF-8. */ private String pickEncoding(InputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader != null) { return CHARACTER_ENCODING; } String encoding = inputSource.getEncoding(); return encoding == null ? DEFAULT_ENCODING : encoding; }
/** * Picks an encoding for an external entity. Defaults to UTF-8. */ private String pickEncoding(InputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader != null) { return CHARACTER_ENCODING; } String encoding = inputSource.getEncoding(); return encoding == null ? DEFAULT_ENCODING : encoding; }
InputSource isrc = ss.getInputSource(); if (isrc != null) { encoding = isrc.getEncoding(); in = isrc.getByteStream(); if (in == null) {
String encoding = source.getEncoding(); XmlOptions options = new XmlOptions(); options.setLoadLineNumbers();
//Convert InputStrean to InputSource final InputSource source = new InputSource(feed); //If encondind is not detect , then read head xml and set enconding if(source.getEncoding()==null){ //THIS THE PROBLEM //The enconding is null, but in entity have head with type enconding source.setEncoding(getEncondingFromEntity(entity)); } /*Now your InputSource have the correct enconding, then use "source" in your parse. Ex:*/ final XMLReader xmlreader = parser.getXMLReader(); final RSSHandler handler = new RSSHandler(config); xmlreader.setContentHandler(handler); xmlreader.parse(source);
private static String getOriginalContent(InputSource s) throws IOException { return s.getCharacterStream() instanceof DoctypeReader ? ((DoctypeReader) s.getCharacterStream()).getContent() : ((DoctypeInputStream) s.getByteStream()) .getContent(s.getEncoding()); } }
public ParsedPattern parseInclude(String uri, SchemaBuilder sb, IncludedGrammar g, String inheritedNs) throws BuildException, IllegalSchemaException { InputSource tem = new InputSource(uri); tem.setEncoding(in.getEncoding()); return new CompactSyntax(this, makeReader(tem), uri, sb, eh, inheritedNs).parseInclude(g); }
public ParsedPattern parseInclude(String uri, SchemaBuilder sb, IncludedGrammar g, String inheritedNs) throws BuildException, IllegalSchemaException { InputSource tem = new InputSource(uri); tem.setEncoding(in.getEncoding()); return new CompactSyntax(this, makeReader(tem), uri, sb, eh, inheritedNs).parseInclude(g); }
public static void setInput(Input input, InputSource inputSource) { input.setByteStream(inputSource.getByteStream()); input.setCharacterStream(inputSource.getCharacterStream()); input.setUri(inputSource.getSystemId()); input.setEncoding(inputSource.getEncoding()); }
public SAXInputSource(XMLReader reader, InputSource inputSource) { super(inputSource != null ? inputSource.getPublicId() : null, inputSource != null ? inputSource.getSystemId() : null, null); if (inputSource != null) { setByteStream(inputSource.getByteStream()); setCharacterStream(inputSource.getCharacterStream()); setEncoding(inputSource.getEncoding()); } fInputSource = inputSource; fXMLReader = reader; }