Package org.apache.jasper.xmlparser
Class ParserUtils
java.lang.Object
org.apache.jasper.xmlparser.ParserUtils
XML parsing utilities for processing web application deployment
descriptor and tag library descriptor files. FIXME - make these
use a separate class loader for the parser to be used.
- Version:
- $Revision: 1.11 $ $Date: 2007/05/05 05:32:59 $
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String[]
List of the Public IDs that we cache, and their associated location.(package private) static final String[]
(package private) static final String[]
private static final String[]
private static final String[]
(package private) static String
(package private) static EntityResolver
An entity resolver for use when parsing XML documents.private static ErrorHandler
An error handler for use when parsing XML documents.(package private) static boolean
(package private) static boolean
(package private) static Logger
private static final String
(package private) static String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TreeNode
Create and return a TreeNode that corresponds to the specified Node, including processing all of the attributes and children nodes.private static Schema
private static Schema
parseXMLDocument
(String uri, InputStream is) Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.parseXMLDocument
(String uri, InputStream is, boolean validate) Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.parseXMLDocument
(String uri, InputSource is) Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.parseXMLDocument
(String uri, InputSource is, boolean validate) Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.static void
setDtdResourcePrefix
(String prefix) Sets the path prefix URL for .dtd resourcesstatic void
static void
setSchemaResourcePrefix
(String prefix) Sets the path prefix URL for .xsd resourcesprivate static String
-
Field Details
-
log
-
errorHandler
An error handler for use when parsing XML documents. -
entityResolver
An entity resolver for use when parsing XML documents. -
schemaResourcePrefix
-
dtdResourcePrefix
-
isDtdResourcePrefixFileUrl
static boolean isDtdResourcePrefixFileUrl -
isSchemaResourcePrefixFileUrl
static boolean isSchemaResourcePrefixFileUrl -
SCHEMA_LOCATION_ATTR
- See Also:
-
schemaCache
-
CACHED_DTD_PUBLIC_IDS
List of the Public IDs that we cache, and their associated location. This is used by an EntityResolver to return the location of the cached copy of a DTD. -
DEFAULT_DTD_RESOURCE_PATHS
-
CACHED_DTD_RESOURCE_PATHS
-
DEFAULT_SCHEMA_RESOURCE_PATHS
-
CACHED_SCHEMA_RESOURCE_PATHS
-
-
Constructor Details
-
ParserUtils
public ParserUtils() -
ParserUtils
public ParserUtils(boolean blockExternal)
-
-
Method Details
-
setEntityResolver
-
setSchemaResourcePrefix
Sets the path prefix URL for .xsd resources -
setDtdResourcePrefix
Sets the path prefix URL for .dtd resources -
uencode
-
parseXMLDocument
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input source containing the deployment descriptor- Throws:
JasperException
- if an I/O or parsing error has occurred
-
parseXMLDocument
public TreeNode parseXMLDocument(String uri, InputSource is, boolean validate) throws JasperException Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input source containing the deployment descriptorvalidate
- true if the XML document needs to be validated against its DTD or schema, false otherwise- Throws:
JasperException
- if an I/O or parsing error has occurred
-
parseXMLDocument
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input stream containing the deployment descriptor- Throws:
JasperException
- if an I/O or parsing error has occurred
-
parseXMLDocument
public TreeNode parseXMLDocument(String uri, InputStream is, boolean validate) throws JasperException Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input stream containing the deployment descriptorvalidate
- true if the XML document needs to be validated against its DTD or schema, false otherwise- Throws:
JasperException
- if an I/O or parsing error has occurred
-
convert
Create and return a TreeNode that corresponds to the specified Node, including processing all of the attributes and children nodes.- Parameters:
parent
- The parent TreeNode (if any) for the new TreeNodenode
- The XML document Node to be converted
-
getSchema
- Throws:
SAXException
JasperException
-
getSchema
- Throws:
SAXException
-