Details
-
Type:
New Feature
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.11.0
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Problem noticed with:
* jdk1.7.0_71.jdk
* jdk1.8.0_25.jdk
Description
I have tons of the following warnings in my console when doing an XSLT transformation:
Warning: org.apache.xerces.parsers.SAXParser: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized. Warning: org.apache.xerces.parsers.SAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized. Warning: org.apache.xerces.parsers.SAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
Code:
/**
* Parse and pretty pint a XML content.
*
* @param content the XML content to format
* @return the formated version of the passed XML content
* @throws TransformerFactoryConfigurationError when failing to create a
* {@link TransformerFactoryConfigurationError}
* @throws TransformerException when failing to transform the content
* @since 5.2M1
*/
public static String formatXMLContent(String content) throws TransformerFactoryConfigurationError,
TransformerException
{
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
StreamResult result = new StreamResult(new StringWriter());
StreamSource source = new StreamSource(new StringReader(content));
transformer.transform(source, result);
return result.getWriter().toString();
}
According to what I read at https://issues.apache.org/jira/browse/RAT-158 and at http://docs.oracle.com/javase/tutorial/jaxp/limits/limits.html this seems to have been caused by some changes introduced in the JDK and that XercesJ doesn't support yet.
Thus this issue is about adding support for them.
Thanks!