use of com.ctc.wstx.api.ReaderConfig in project flink by apache.
the class Configuration method parse.
private XMLStreamReader parse(InputStream is, String systemIdStr, boolean restricted) throws IOException, XMLStreamException {
if (!quietmode) {
LOG.debug("parsing input stream " + is);
}
if (is == null) {
return null;
}
SystemId systemId = SystemId.construct(systemIdStr);
ReaderConfig readerConfig = XML_INPUT_FACTORY.createPrivateConfig();
if (restricted) {
readerConfig.setProperty(XMLInputFactory.SUPPORT_DTD, false);
}
return XML_INPUT_FACTORY.createSR(readerConfig, systemId, StreamBootstrapper.getInstance(null, systemId, is), false, true);
}
use of com.ctc.wstx.api.ReaderConfig in project iaf by ibissource.
the class XmlUtils method getVersionInfo.
public static Map<String, String> getVersionInfo() {
Map<String, String> map = new LinkedHashMap<>();
SAXParserFactory spFactory = getSAXParserFactory();
map.put("SAXParserFactory-class", spFactory.getClass().getName());
DocumentBuilderFactory domFactory1 = getDocumentBuilderFactory(false);
map.put("DocumentBuilderFactory1-class", domFactory1.getClass().getName());
DocumentBuilderFactory domFactory2 = getDocumentBuilderFactory(true);
map.put("DocumentBuilderFactory2-class", domFactory2.getClass().getName());
TransformerFactory tFactory1 = getTransformerFactory(1);
map.put("TransformerFactory1-class", tFactory1.getClass().getName());
TransformerFactory tFactory2 = getTransformerFactory(2);
map.put("TransformerFactory2-class", tFactory2.getClass().getName());
XMLEventFactory xmlEventFactory = XMLEventFactory.newInstance();
map.put("XMLEventFactory-class", xmlEventFactory.getClass().getName());
XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
map.put("XMLInputFactory-class", xmlInputFactory.getClass().getName());
XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newInstance();
map.put("XMLOutputFactory-class", xmlOutputFactory.getClass().getName());
try {
MessageFactory messageFactory = MessageFactory.newInstance();
map.put("MessageFactory-class", messageFactory.getClass().getName());
} catch (SOAPException e) {
log.warn("unable to create MessageFactory", e);
map.put("MessageFactory-class", "unable to create MessageFactory (" + e.getClass().getName() + "): " + e.getMessage() + ")");
}
try {
map.put("Xerces-Version", org.apache.xerces.impl.Version.getVersion());
} catch (Throwable t) {
log.warn("could not get Xerces version", t);
map.put("Xerces-Version", "not found (" + t.getClass().getName() + "): " + t.getMessage() + ")");
}
try {
String xalanVersion = org.apache.xalan.Version.getVersion();
map.put("Xalan-Version", xalanVersion);
} catch (Throwable t) {
log.warn("could not get Xalan version", t);
map.put("Xalan-Version", "not found (" + t.getClass().getName() + "): " + t.getMessage() + ")");
}
try {
String saxonVersion = net.sf.saxon.Version.getProductTitle();
map.put("Saxon-Version", saxonVersion);
} catch (Throwable t) {
log.warn("could not get Saxon version", t);
map.put("Saxon-Version", "not found (" + t.getClass().getName() + "): " + t.getMessage() + ")");
}
try {
if (xmlInputFactory instanceof WstxInputFactory) {
ReaderConfig woodstoxConfig = ((WstxInputFactory) xmlInputFactory).createPrivateConfig();
String woodstoxVersion = ReaderConfig.getImplName() + " " + ReaderConfig.getImplVersion() + "; xml1.1 " + (woodstoxConfig.isXml11() ? "" : "not ") + "enabled";
map.put("Woodstox-Version", woodstoxVersion);
}
} catch (Throwable t) {
log.warn("could not get Woodstox version", t);
map.put("Woodstox-Version", "not found (" + t.getClass().getName() + "): " + t.getMessage() + ")");
}
return map;
}
use of com.ctc.wstx.api.ReaderConfig in project iaf by ibissource.
the class StaxParserFactory method createPrivateConfig.
/**
* Enable XML 1.1, to avoid errors like:
* Illegal character entity: expansion character (code 0x3 at [row,col {unknown-source}]: [1,53]
*/
@Override
public ReaderConfig createPrivateConfig() {
ReaderConfig result = super.createPrivateConfig();
result.enableXml11(true);
return result;
}
Aggregations