public class XMLUtils
extends java.lang.Object
Constructor and Description |
---|
XMLUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escapeXml(java.lang.String xml)
Escapes the characters in a String using XML entities.
|
static java.lang.String |
removeXMLComments(java.lang.String input)
Removes all XML comments from a String.
|
static java.lang.StringBuffer |
stripXmlDeclaration(java.io.BufferedReader rdr)
Strips the XML declaration and DTD declaration from the given XML.
|
static java.lang.String |
xml2json(java.lang.String xml)
Convert XML to JSON.
|
public static java.lang.String removeXMLComments(java.lang.String input)
input
- XML Stringpublic static final java.lang.StringBuffer stripXmlDeclaration(java.io.BufferedReader rdr) throws java.io.IOException
rdr
- A BufferedReader containing XML.java.io.IOException
- If errorpublic static final java.lang.String xml2json(java.lang.String xml)
xml
- An XML String.public static final java.lang.String escapeXml(java.lang.String xml)
xml
- The String to escape, may be null