"dnaxml:target=" + target,
"dnaxml:processingInstructionContent=" + data);
}
protected void parse( String relativePathToXmlFile ) throws IOException, SAXException {
Stopwatch sw = new Stopwatch();
sw.start();
InputStream stream = getClass().getClassLoader().getResourceAsStream(relativePathToXmlFile);
try {
XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setContentHandler(handler);
reader.setErrorHandler(handler);
// Ensure handler acting as entity resolver 2
reader.setProperty(XmlSequencer.DECL_HANDLER_FEATURE, handler);
// Ensure handler acting as lexical handler
reader.setProperty(XmlSequencer.LEXICAL_HANDLER_FEATURE, handler);
// Ensure handler acting as entity resolver 2
XmlSequencer.setFeature(reader, XmlSequencer.ENTITY_RESOLVER_2_FEATURE, true);
// Prevent loading of external DTDs
XmlSequencer.setFeature(reader, XmlSequencer.LOAD_EXTERNAL_DTDS_FEATURE, false);
// Prevent the resolving of DTD entities into fully-qualified URIS
XmlSequencer.setFeature(reader, XmlSequencer.RESOLVE_DTD_URIS_FEATURE, false);
reader.parse(new InputSource(stream));
} finally {
if (stream != null) stream.close();
sw.stop();
System.out.println("Parsing: " + sw);
}
pathsInCreationOrder = new LinkedList<Path>(output.getOrderOfCreation());
}