| java.lang.Object org.netbeans.modules.sql.framework.common.utils.XmlUtil
XmlUtil | public class XmlUtil (Code) | | Static class that contains utility methods for XML
author: Ahimanikya Satapathy version: $Revision$ |
Field Summary | |
final public static String[] | HTML_ALLOWABLES HTML_SUBSTITUTES is a list of character substitutes for XML_ILLEGALS. | final public static String[] | HTML_ILLEGALS HTML_ILLEGALS is a list of character strings not parseable by XML. | final public static String[] | XML_ALLOWABLES XML_SUBSTITUTES is a list of character substitutes for XML_ILLEGALS. | final public static String[] | XML_ILLEGALS XML_ILLEGALS is a list of character strings not parseable by XML. |
Method Summary | |
public static void | dumpXMLString(String fileName, String xmlString) Writes given XML string to file with given filename. | public static String | escapeHTML(String string) The escapeXML method is used to replace illegal xml characters with their
acceptable equivalents.
Parameters: string - String requiring replacement of characters. | public static String | escapeXML(String string) The escapeXML method is used to replace illegal xml characters with their
acceptable equivalents.
Parameters: string - String requiring replacement of characters. | public static String | getAttributeFrom(Element element, String attrName, boolean nullIfEmptyString) Extracts attribute, if any, with given name from given DOM element.
Parameters: element - DOM element in which to locate attribute Parameters: attrName - name of attribute to extract Parameters: nullIfEmptyString - indicates whether to return null if attribute is not foundor returns as empty string attribute value as String. | public static Element | loadXMLFile(BufferedReader reader) Reads in String XML content from given BufferedReader and converts it to a DOM
Element for parsing. | public static Element | loadXMLFile(Reader aReader) Reads in String XML content from given reader and converts it to a DOM Element for
parsing. | public static Element | loadXMLFile(String fileName) Reads in String XML content from a file with the given name and converts it to a
DOM Element for parsing. | public static Element | loadXMLFile(String fileName, ClassLoader classLoader) Reads in String XML content from a file with the given name and converts it to a
DOM Element for parsing. | public static Element | loadXMLString(String xmlString) Reads in String XML content from given reader and converts it to a DOM Element for
parsing. | public static String | toXmlString(Element element) | public static Element | transform(URL xslFileUrl, Element sourceElem) |
HTML_ALLOWABLES | final public static String[] HTML_ALLOWABLES(Code) | | HTML_SUBSTITUTES is a list of character substitutes for XML_ILLEGALS.
|
HTML_ILLEGALS | final public static String[] HTML_ILLEGALS(Code) | | HTML_ILLEGALS is a list of character strings not parseable by XML.
|
XML_ALLOWABLES | final public static String[] XML_ALLOWABLES(Code) | | XML_SUBSTITUTES is a list of character substitutes for XML_ILLEGALS.
|
XML_ILLEGALS | final public static String[] XML_ILLEGALS(Code) | | XML_ILLEGALS is a list of character strings not parseable by XML.
|
dumpXMLString | public static void dumpXMLString(String fileName, String xmlString)(Code) | | Writes given XML string to file with given filename.
Parameters: fileName - name of file to receive XML output. Parameters: xmlString - XML content to write out. |
escapeHTML | public static String escapeHTML(String string)(Code) | | The escapeXML method is used to replace illegal xml characters with their
acceptable equivalents.
Parameters: string - String requiring replacement of characters. String with illegal characters translated. |
escapeXML | public static String escapeXML(String string)(Code) | | The escapeXML method is used to replace illegal xml characters with their
acceptable equivalents.
Parameters: string - String requiring replacement of characters. String with illegal characters translated. |
getAttributeFrom | public static String getAttributeFrom(Element element, String attrName, boolean nullIfEmptyString)(Code) | | Extracts attribute, if any, with given name from given DOM element.
Parameters: element - DOM element in which to locate attribute Parameters: attrName - name of attribute to extract Parameters: nullIfEmptyString - indicates whether to return null if attribute is not foundor returns as empty string attribute value as String. If parsing the element for attrName results inan empty String (or if either element or attrName are null), then returnnull if nullIfEmptyString is true, else return an empty String. |
loadXMLFile | public static Element loadXMLFile(BufferedReader reader)(Code) | | Reads in String XML content from given BufferedReader and converts it to a DOM
Element for parsing.
Parameters: reader - BufferedReader supplying String XML content XML content as a DOM element |
loadXMLFile | public static Element loadXMLFile(Reader aReader)(Code) | | Reads in String XML content from given reader and converts it to a DOM Element for
parsing.
Parameters: aReader - Reader supplying String XML content XML content as a DOM element |
loadXMLFile | public static Element loadXMLFile(String fileName)(Code) | | Reads in String XML content from a file with the given name and converts it to a
DOM Element for parsing.
Parameters: fileName - name of file containing XML content XML content as a DOM element |
loadXMLFile | public static Element loadXMLFile(String fileName, ClassLoader classLoader)(Code) | | Reads in String XML content from a file with the given name and converts it to a
DOM Element for parsing.
Parameters: fileName - name of file containing XML content Parameters: classLoader - ClassLoader to use in resolving fileName XML content as a DOM element |
loadXMLString | public static Element loadXMLString(String xmlString)(Code) | | Reads in String XML content from given reader and converts it to a DOM Element for
parsing.
Parameters: String - supplying XML content XML content as a DOM element |
|
|