Class XMLUtil
java.lang.Object
com.inductiveautomation.ignition.common.XMLUtil
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseElement(PrintWriter out, String element) Writes </element>static DocumentBuilderFactoryThe createSafeDocumentBuilderFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static SAXParserFactoryThe createSafeSAXParserFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static TransformerFactorystatic XMLReaderThe createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static XMLReadercreateSafeXMLReader(String className) The createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static voidstatic voidopenElement(PrintWriter out, String element) Writes <element>static voidprintXMLHead(PrintWriter out) static voidprintXMLHead(Writer out) static voidstatic voidprintXMLHead(Formatter out) static Stringstatic voidsetSafetyFeatures(XMLReader reader) Sets safety features on the provided XMLReader instancestatic voidwriteElement(PrintWriter out, String element, String contents) Writes <element>contents</element> , quoting the contents. 
- 
Field Details
- 
dateFormat
 
 - 
 - 
Constructor Details
- 
XMLUtil
public XMLUtil() 
 - 
 - 
Method Details
- 
createSafeDocumentBuilderFactory
The createSafeDocumentBuilderFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://www.owasp.org/index.php/XML_External_Entity_%28XXE%29_Processing for more info
 - 
createSafeTransformerFactory
 - 
createSafeSAXParserFactory
The createSafeSAXParserFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://www.owasp.org/index.php/XML_External_Entity_%28XXE%29_Processing for more info
 - 
createSafeXMLReader
The createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xmlreader for more info
- Throws:
 SAXException
 - 
createSafeXMLReader
The createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xmlreader for more info
Calls
XMLReaderFactory.createXMLReader(String)and provides the given className- Throws:
 SAXException
 - 
setSafetyFeatures
Sets safety features on the provided XMLReader instanceSee: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xmlreader for more info
 - 
printXMLHead
- Throws:
 IOException
 - 
printXMLHead
 - 
printXMLHead
 - 
printXMLHead
 - 
openElement
Writes <element> - 
closeElement
Writes </element> - 
writeElement
Writes <element>contents</element> , quoting the contents. If contents is null, writes <element/> - 
main
 - 
quoteCharacters
 
 -