org.apache.ivy.util
Class XMLHelper
public abstract
class
XMLHelper
extends Object
Method Summary |
static boolean | canUseSchemaValidation() |
static String | escape(String text)
Escapes invalid XML characters in the given character data using XML entities.
|
static DocumentBuilder | getDocBuilder(EntityResolver entityResolver) |
static void | parse(URL xmlURL, URL schema, DefaultHandler handler) |
static void | parse(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler) |
static void | parse(InputStream xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) |
static void | parse(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) |
static Document | parseToDom(InputStream stream, Resource res, EntityResolver entityResolver) |
public static boolean canUseSchemaValidation()
public static String escape(String text)
Escapes invalid XML characters in the given character data using XML entities.
For the moment, only the following characters are being escaped: (<), (&), (')
and (").
Remark: we don't escape the (>) character to keep the readability of the
configuration mapping! The XML spec only requires that the (&) and (<)
characters are being escaped inside character data.
Parameters: text the character data to escape
Returns: the escaped character data
public static DocumentBuilder getDocBuilder(EntityResolver entityResolver)
public static void parse(URL xmlURL, URL schema, DefaultHandler handler)
public static void parse(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler)
public static void parse(InputStream xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler)
public static void parse(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler)
public static Document parseToDom(InputStream stream,
Resource res, EntityResolver entityResolver)