public <T extends Element> Document<T> parse(Reader in, String base, ParserOptions options) throws ParseException { if (in == null) throw new IllegalArgumentException(Localizer.get("READER.NOT.NULL")); try { if (options == null) options = getDefaultParserOptions(); if (options.getFilterRestrictedCharacters() && !(in instanceof FOMXmlRestrictedCharReader)) { in = new FOMXmlRestrictedCharReader(in, options.getFilterRestrictedCharacterReplacement()); } // return parse(StAXUtils.createXMLStreamReader(in), base, options); return parse(createXMLStreamReader(in), base, options); } catch (Exception e) { if (!(e instanceof ParseException)) e = new ParseException(e); throw (ParseException)e; } }
in = sin; if (options.getFilterRestrictedCharacters()) { Reader rdr = (charset == null)