| java.lang.Object org.gjt.sp.util.XMLUtilities
XMLUtilities | public class XMLUtilities (Code) | | XML utility methods that only depend on the JDK.
author: Marcelo Vanzin version: $Id: XMLUtilities.java 10892 2007-10-14 10:54:49Z k_satoda $ since: 4.3pre6 |
charsToEntities | public static String charsToEntities(String str, boolean xml11)(Code) | | Converts <, >, & in the string to their HTML entity
equivalents.
If xml11 is true, then character entities
are used to convert illegal XML characters (mainly ASCII
control characters).
Parameters: str - The string Parameters: xml11 - Whether to allow XML 1.1 constructs. |
findEntity | public static InputSource findEntity(String systemId, String test, Class where)(Code) | | Tries to find the given systemId in the context of the given
class. If the given systemId ends with the given test string,
then try to load a resource using the Class's
getResourceAsStream() method using the test string
as the resource.
This is used a lot internally while parsing XML files used
by jEdit, but anyone is free to use the method if it sounds
usable.
|
parseXML | public static boolean parseXML(InputStream in, DefaultHandler handler) throws IOException(Code) | | Convenience method for parsing an XML file. This method will
wrap the resource in an InputSource and set the source's
systemId to "jedit.jar" (so the source should be able to
handle any external entities by itself).
SAX Errors are caught and are not propagated to the caller;
instead, an error message is printed to jEdit's activity
log. So, if you need custom error handling, do not use
this method.
The given stream is closed before the method returns,
regardless whether there were errors or not.
true if any error occured during parsing, false if success. |
|
|