FileDocCategorySizeDatePackage
ResolvingXMLReader.javaAPI DocJava SE 6 API2819Tue Jun 10 00:23:00 BST 2008com.sun.org.apache.xml.internal.resolver.tools

ResolvingXMLReader

public class ResolvingXMLReader extends ResolvingXMLFilter
A SAX XMLReader that performs catalog-based entity resolution.

This class implements a SAX XMLReader that performs entity resolution using the CatalogResolver. The actual, underlying parser is obtained from a SAXParserFactory.

see
CatalogResolver
see
org.xml.sax.XMLReader
author
Norman Walsh Norman.Walsh@Sun.COM
version
1.0

Fields Summary
public static boolean
namespaceAware
Make the parser Namespace aware?
public static boolean
validating
Make the parser validating?
Constructors Summary
public ResolvingXMLReader()
Construct a new reader from the JAXP factory.

In order to do its job, a ResolvingXMLReader must in fact be a filter. So the only difference between this code and the filter code is that the constructor builds a new reader.


                                              
    
    super();
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(namespaceAware);
    spf.setValidating(validating);
    try {
      SAXParser parser = spf.newSAXParser();
      setParent(parser.getXMLReader());
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  
public ResolvingXMLReader(CatalogManager manager)
Construct a new reader from the JAXP factory.

In order to do its job, a ResolvingXMLReader must in fact be a filter. So the only difference between this code and the filter code is that the constructor builds a new reader.

    super(manager);
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(namespaceAware);
    spf.setValidating(validating);
    try {
      SAXParser parser = spf.newSAXParser();
      setParent(parser.getXMLReader());
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  
Methods Summary