Package org.apache.ivy.util
Class XMLHelper
java.lang.Object
org.apache.ivy.util.XMLHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static String
Escapes invalid XML characters in the given character data using XML entities.static DocumentBuilder
getDocBuilder
(EntityResolver entityResolver) static void
parse
(InputStream xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) static void
parse
(URL xmlURL, URL schema, DefaultHandler handler) static void
parse
(URL xmlURL, URL schema, DefaultHandler handler, LexicalHandler lHandler) static void
parse
(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler) static void
parse
(InputSource xmlStream, URL schema, DefaultHandler handler, LexicalHandler lHandler, boolean loadExternalDtds) static Document
parseToDom
(InputSource source, EntityResolver entityResolver) static String
toSystemId
(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:
IOException
SAXException
-
getDocBuilder
-