@Test(expected = AssertionError.class) public void resolveXInclude_keepXMLBase() throws SAXException, IOException { File file = new File("src/test/resources/article.xml"); SAXParser parser = XMLParserUtils.createXIncludeAwareSAXParser(true); XMLReader reader = parser.getXMLReader(); reader.setFeature("http: LegalNoticeHandler handler = new LegalNoticeHandler(); parser.parse(file, handler); }
public static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup) { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setXIncludeAware(true); SAXParser parser = null; try { factory.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE, doBaseURIFixup); parser = factory.newSAXParser(); } catch (Exception x) { throw new RuntimeException(x); } return parser; }
XMLParserUtils { public static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup) { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setXIncludeAware(true); SAXParser parser = null; try { factory.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE, doBaseURIFixup); parser = factory.newSAXParser(); } catch (Exception x) { throw new RuntimeException(x); } return parser; } }
XMLParserUtils { public static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup) { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setXIncludeAware(true); SAXParser parser = null; try { factory.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE, doBaseURIFixup); parser = factory.newSAXParser(); } catch (Exception x) { throw new RuntimeException(x); } return parser; } private  XMLParserUtils(); }
XMLParserUtils { public static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup) { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setXIncludeAware(true); SAXParser parser = null; try { factory.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE, doBaseURIFixup); parser = factory.newSAXParser(); } catch (Exception x) { throw new RuntimeException(x); } return parser; } private  XMLParserUtils(); static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup); }
XMLParserUtils { public static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup) { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setXIncludeAware(true); SAXParser parser = null; try { factory.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE, doBaseURIFixup); parser = factory.newSAXParser(); } catch (Exception x) { throw new RuntimeException(x); } return parser; } private  XMLParserUtils(); static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup);  }