Package org.apache.ivy.util
Class XMLHelper
java.lang.Object
org.apache.ivy.util.XMLHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic StringEscapes invalid XML characters in the given character data using XML entities.static DocumentBuildergetDocBuilder(EntityResolver entityResolver) static voidparse(InputStream xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) static voidparse(URL xmlURL, URL schema, DefaultHandler handler) static voidparse(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler) static voidparse(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) static voidparse(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler, boolean loadExternalDtds) static DocumentparseToDom(InputSource source, EntityResolver entityResolver) static StringtoSystemId(URL url) Convert an URL to a valid systemId according to RFC 2396.
-
Method Details
-
toSystemId
Convert an URL to a valid systemId according to RFC 2396.- Parameters:
url- URL- Returns:
- String
-
parse
public static void parse(URL xmlURL, URL schema, DefaultHandler handler) throws SAXException, IOException, ParserConfigurationException -
parse
public static void parse(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler) throws SAXException, IOException, ParserConfigurationException -
parse
public static void parse(InputStream xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) throws SAXException, IOException, ParserConfigurationException -
parse
public static void parse(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) throws SAXException, IOException, ParserConfigurationException -
parse
public static void parse(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler, boolean loadExternalDtds) throws SAXException, IOException, ParserConfigurationException -
canUseSchemaValidation
public static boolean canUseSchemaValidation() -
escape
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
-
parseToDom
public static Document parseToDom(InputSource source, EntityResolver entityResolver) throws IOException, SAXException - Throws:
IOExceptionSAXException
-
getDocBuilder
-