Class XMLUtil
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.XMLUtil
 
- 
 public class XMLUtil extends java.lang.Object
- 
- 
Field SummaryFields Modifier and Type Field Description static java.text.DateFormatdateFormat
 - 
Constructor SummaryConstructors Constructor Description XMLUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseElement(java.io.PrintWriter out, java.lang.String element)Writes </element>static javax.xml.parsers.DocumentBuilderFactorycreateSafeDocumentBuilderFactory()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.static javax.xml.parsers.SAXParserFactorycreateSafeSAXParserFactory()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.static javax.xml.transform.TransformerFactorycreateSafeTransformerFactory()static org.xml.sax.XMLReadercreateSafeXMLReader()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 org.xml.sax.XMLReadercreateSafeXMLReader(java.lang.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 voidmain(java.lang.String[] args)static voidopenElement(java.io.PrintWriter out, java.lang.String element)Writes <element>static voidprintXMLHead(java.io.PrintWriter out)static voidprintXMLHead(java.io.Writer out)static voidprintXMLHead(java.lang.StringBuilder out)static voidprintXMLHead(java.util.Formatter out)static java.lang.StringquoteCharacters(java.lang.String s)static voidsetSafetyFeatures(org.xml.sax.XMLReader reader)Sets safety features on the provided XMLReader instancestatic voidwriteElement(java.io.PrintWriter out, java.lang.String element, java.lang.String contents)Writes <element>contents</element> , quoting the contents.
 
- 
- 
- 
Method Detail- 
createSafeDocumentBuilderFactorypublic static javax.xml.parsers.DocumentBuilderFactory 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 
 - 
createSafeTransformerFactorypublic static javax.xml.transform.TransformerFactory createSafeTransformerFactory() 
 - 
createSafeSAXParserFactorypublic static javax.xml.parsers.SAXParserFactory 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 
 - 
createSafeXMLReaderpublic static org.xml.sax.XMLReader createSafeXMLReader() throws org.xml.sax.SAXExceptionThe 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()- Throws:
- org.xml.sax.SAXException
 
 - 
createSafeXMLReaderpublic static org.xml.sax.XMLReader createSafeXMLReader(java.lang.String className) throws org.xml.sax.SAXExceptionThe 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:
- org.xml.sax.SAXException
 
 - 
setSafetyFeaturespublic static void setSafetyFeatures(org.xml.sax.XMLReader reader) Sets safety features on the provided XMLReader instanceSee: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xmlreader for more info 
 - 
printXMLHeadpublic static void printXMLHead(java.io.Writer out) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
printXMLHeadpublic static void printXMLHead(java.io.PrintWriter out) 
 - 
printXMLHeadpublic static void printXMLHead(java.util.Formatter out) 
 - 
printXMLHeadpublic static void printXMLHead(java.lang.StringBuilder out) 
 - 
openElementpublic static void openElement(java.io.PrintWriter out, java.lang.String element)Writes <element>
 - 
closeElementpublic static void closeElement(java.io.PrintWriter out, java.lang.String element)Writes </element>
 - 
writeElementpublic static void writeElement(java.io.PrintWriter out, java.lang.String element, java.lang.String contents)Writes <element>contents</element> , quoting the contents. If contents is null, writes <element/>
 - 
mainpublic static void main(java.lang.String[] args) 
 - 
quoteCharacterspublic static java.lang.String quoteCharacters(java.lang.String s) 
 
- 
 
-