List of usage examples for javax.xml.parsers DocumentBuilderFactory isIgnoringComments
public boolean isIgnoringComments()
From source file:org.apache.xml.security.test.signature.ECDSASignatureTest.java
protected void setUp() throws Exception { //// ww w . j ava 2 s .co m // If the BouncyCastle provider is not installed, then try to load it // via reflection. If it is not available, then skip this test as it is // required for elliptic curves // if (Security.getProvider("BC") == null) { Constructor cons = null; try { Class c = Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider"); cons = c.getConstructor(new Class[] {}); } catch (Exception e) { //ignore } if (cons == null) { // BouncyCastle is not available so just return return; } else { Security.addProvider((java.security.Provider) cons.newInstance(new Object[] {})); } } javax.xml.parsers.DocumentBuilderFactory dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); log.info("dbf.isIgnoringComments()=" + dbf.isIgnoringComments()); log.info("dbf.isIgnoringElementContentWhitespace()=" + dbf.isIgnoringElementContentWhitespace()); String id = "http://apache.org/xml/properties/dom/document-class-name"; dbf.setAttribute(id, IndexedDocument.class.getName()); db = dbf.newDocumentBuilder(); org.apache.xml.security.Init.init(); }