com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Resolver.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #2
Source File: Catalog.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #3
Source File: ResolvingParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #4
Source File: Resolver.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #5
Source File: Catalog.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #6
Source File: ResolvingParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #7
Source File: Resolver.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #8
Source File: Catalog.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #9
Source File: ResolvingParser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #10
Source File: Resolver.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #11
Source File: Catalog.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #12
Source File: ResolvingParser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #13
Source File: Resolver.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #14
Source File: Resolver.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #15
Source File: ResolvingParser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #16
Source File: ResolvingParser.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #17
Source File: Catalog.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #18
Source File: Catalog.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(true);
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example #19
Source File: ResolvingXMLReader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>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.</p>
 */
public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #20
Source File: ResolvingXMLReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>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.</p>
 */
public ResolvingXMLReader() {
  super();
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #21
Source File: ResolvingXMLReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>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.</p>
 */
public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #22
Source File: XMLCatalogResolver.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Attaches the reader to the catalog.
 */
private void attachReaderToCatalog (Catalog catalog) {

    SAXParserFactory spf = new SAXParserFactoryImpl();
    spf.setNamespaceAware(true);
    spf.setValidating(false);

    SAXCatalogReader saxReader = new SAXCatalogReader(spf);
    saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog",
        "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
    catalog.addReader("application/xml", saxReader);
}
 
Example #23
Source File: XMLCatalogResolver.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Attaches the reader to the catalog.
 */
private void attachReaderToCatalog (Catalog catalog) {

    SAXParserFactory spf = new SAXParserFactoryImpl();
    spf.setNamespaceAware(true);
    spf.setValidating(false);

    SAXCatalogReader saxReader = new SAXCatalogReader(spf);
    saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog",
        "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
    catalog.addReader("application/xml", saxReader);
}
 
Example #24
Source File: JdkXmlUtils.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a SAXParserFactory instance.
 *
 * @param overrideDefaultParser a flag indicating whether the system-default
 * implementation may be overridden. If the system property of the
 * DOM factory ID is set, override is always allowed.
 *
 * @return a SAXParserFactory instance.
 */
public static SAXParserFactory getSAXFactory(boolean overrideDefaultParser) {
    boolean override = overrideDefaultParser;
    String spSAXFactory = SecuritySupport.getJAXPSystemProperty(SAX_FACTORY_ID);
    if (spSAXFactory != null && System.getSecurityManager() == null) {
        override = true;
    }

    SAXParserFactory factory
            = !override
                    ? new SAXParserFactoryImpl()
                    : SAXParserFactory.newInstance();
    factory.setNamespaceAware(true);
    return factory;
}
 
Example #25
Source File: ResolvingXMLReader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>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.</p>
 */
public ResolvingXMLReader() {
  super();
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #26
Source File: XMLCatalogResolver.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Attaches the reader to the catalog.
 */
private void attachReaderToCatalog (Catalog catalog) {

    SAXParserFactory spf = new SAXParserFactoryImpl();
    spf.setNamespaceAware(true);
    spf.setValidating(false);

    SAXCatalogReader saxReader = new SAXCatalogReader(spf);
    saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog",
        "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
    catalog.addReader("application/xml", saxReader);
}
 
Example #27
Source File: ResolvingXMLReader.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>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.</p>
 */
public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #28
Source File: XMLCatalogResolver.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Attaches the reader to the catalog.
 */
private void attachReaderToCatalog (Catalog catalog) {

    SAXParserFactory spf = new SAXParserFactoryImpl();
    spf.setNamespaceAware(true);
    spf.setValidating(false);

    SAXCatalogReader saxReader = new SAXCatalogReader(spf);
    saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog",
        "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
    catalog.addReader("application/xml", saxReader);
}
 
Example #29
Source File: ResolvingXMLReader.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>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.</p>
 */
public ResolvingXMLReader() {
  super();
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example #30
Source File: ResolvingXMLReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>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.</p>
 */
public ResolvingXMLReader() {
  super();
  SAXParserFactory spf = catalogManager.useServicesMechanism() ?
                  SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}