Examples of EntityResolver


Examples of org.xml.sax.EntityResolver

            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
            // docBuilder.
            // docBuilder.isValidating();

            // Disable loading of external Entityes
            docBuilder.setEntityResolver(new EntityResolver() {
                // Dummi resolver - alvays do nothing
                public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
                    return new InputSource(new StringReader(""));
                }
            });
View Full Code Here

Examples of org.xml.sax.EntityResolver

    dbf.setValidating(true);
    dbf.setCoalescing(true);
    dbf.setIgnoringComments(true);
    try {
      DocumentBuilder db = dbf.newDocumentBuilder();
      db.setEntityResolver(new EntityResolver() {

        public InputSource resolveEntity(String pid, String sid)
            throws SAXException {
          if (sid.equals("http://java.sun.com/dtd/properties.dtd")) {
            InputSource is = new InputSource(
View Full Code Here

Examples of org.xml.sax.EntityResolver

   * TODO : woodstox parserfactory synchronization?
   */
  protected synchronized SAXParser getSAXParser()
  throws ParserConfigurationException, SAXException {
    SAXParser saxParser = parserFactory.newSAXParser();
    saxParser.getXMLReader().setEntityResolver(new EntityResolver() {
     
      @Override
      public InputSource resolveEntity(String arg0, String arg1)
          throws SAXException, IOException {
        return null;
View Full Code Here

Examples of org.xml.sax.EntityResolver

   
    try {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setValidating(false);
      DocumentBuilder builder = factory.newDocumentBuilder();
      builder.setEntityResolver(new EntityResolver() {
        public InputSource resolveEntity(String publicId,
            String systemId) throws SAXException, IOException {         
          return new InputSource(new ByteArrayInputStream(new byte[0]));
        }
      });
View Full Code Here

Examples of org.xml.sax.EntityResolver

      debug.message(1, "Cannot read SAX catalog without a parser");
      throw new CatalogException(CatalogException.UNPARSEABLE);
    }

    debug = catalog.getCatalogManager().debug;
    EntityResolver bResolver = catalog.getCatalogManager().getBootstrapResolver();

    this.catalog = catalog;

    try {
      if (parserFactory != null) {
View Full Code Here

Examples of org.xml.sax.EntityResolver

     *         has been registered.
     * @see #setEntityResolver
     */
    public EntityResolver getEntityResolver() {

        EntityResolver entityResolver = null;
        try {
            XMLEntityResolver xmlEntityResolver =
                (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
            if (xmlEntityResolver != null) {
                if (xmlEntityResolver instanceof EntityResolverWrapper) {
View Full Code Here

Examples of org.xml.sax.EntityResolver

     *         has been registered.
     * @see #setEntityResolver
     */
    public EntityResolver getEntityResolver() {

        EntityResolver entityResolver = null;
        try {
            XMLEntityResolver xmlEntityResolver =
                (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
            if (xmlEntityResolver != null) {
                if (xmlEntityResolver instanceof EntityResolverWrapper) {
View Full Code Here

Examples of org.xml.sax.EntityResolver

    }

    public void load(Reader in) throws ConfigurationException
    {
        // set up the DTD validation
        EntityResolver resolver = new EntityResolver()
        {
            public InputSource resolveEntity(String publicId, String systemId)
            {
                return new InputSource(getClass().getClassLoader().getResourceAsStream("PropertyList-1.0.dtd"));
            }
View Full Code Here

Examples of org.xml.sax.EntityResolver

                public void fatalError(SAXParseException e) throws SAXException {
                    throw e;
                }
            });

            builder.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId,
                        String systemId) throws SAXException, IOException {
                    if (systemId.equals(PROP_DTD_NAME)) {
                        InputSource result = new InputSource(new StringReader(PROP_DTD));
                        result.setSystemId(PROP_DTD_NAME);
View Full Code Here

Examples of org.xml.sax.EntityResolver

        InputStream stream = new AddDTDFilterInputStream(URLHandlerRegistry.getDefault()
                .openStream(descriptorURL));
        InputSource source = new InputSource(stream);
        source.setSystemId(XMLHelper.toSystemId(descriptorURL));
        try {
            Document pomDomDoc = XMLHelper.parseToDom(source, new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId)
                        throws SAXException, IOException {
                    if ((systemId != null) && systemId.endsWith("m2-entities.ent")) {
                        return new InputSource(PomReader.class
                                .getResourceAsStream("m2-entities.ent"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.