Package org.xml.sax

Examples of org.xml.sax.EntityResolver


      String outputType = null;
      String media = null;
      Vector params = new Vector();
      boolean quietConflictWarnings = false;
      URIResolver uriResolver = null;
      EntityResolver entityResolver = null;
      ContentHandler contentHandler = null;
      int recursionLimit=-1;

      for (int i = 0; i < argv.length; i++)
      {
View Full Code Here


    {
        // set up the digester
        Digester digester = new Digester();

        // set up the DTD validation
        digester.setEntityResolver(new EntityResolver()
        {
            public InputSource resolveEntity(String publicId, String systemId)
            {
                return new InputSource(getClass().getClassLoader().getResourceAsStream("PropertyList-1.0.dtd"));
            }
View Full Code Here

    Document document;
    Writer writer = null;
    try {
      String content = FileUtils.fileRead(sourceFacesConfigFile);
      SAXBuilder builder = new SAXBuilder();
      builder.setEntityResolver(new EntityResolver() {
        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
          if ("-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN".equals(publicId)) {
            InputStream stream = FacesConfigAnnotationVisitor.class.getResourceAsStream(
                "/org/apache/myfaces/tobago/dtd/web-facesconfig_1_1.dtd");
            return new InputSource(stream);
View Full Code Here

                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));
View Full Code Here

    }

    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

        try
        {
            SAXParser parser = factory.newSAXParser();

            XMLReader xmlReader = parser.getXMLReader();
            xmlReader.setEntityResolver(new EntityResolver()
            {
                public InputSource resolveEntity(String publicId, String systemId)
                {
                    return new InputSource(getClass().getClassLoader().getResourceAsStream("properties.dtd"));
                }
View Full Code Here

//                    XMLReader xliffreader = XMLReaderFactory
//                            .createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
                    xliffreader.setErrorHandler(contentHandler);
                    xliffreader.setContentHandler(contentHandler);
                    /* one possibility to resolve an extern entity (DTD) */
                    EntityResolver res = new Resolver();
                    xliffreader.setEntityResolver(res);
                    /*
                     * a second possibility to resolve an extern entity (DTD)
                     *
                     * xliffreader.setFeature("xml.org/sax/features/validation",true);
 
View Full Code Here

    Document document;
    Writer writer = null;
    try {
      String content = FileUtils.fileRead(sourceFacesConfigFile);
      SAXBuilder builder = new SAXBuilder();
      builder.setEntityResolver(new EntityResolver() {
        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
          if ("-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN".equals(publicId)) {
            InputStream stream = getClass().getResourceAsStream(
                "/org/apache/myfaces/tobago/dtd/web-facesconfig_1_1.dtd");
            return new InputSource(stream);
View Full Code Here

  public SeleniumScript(URL scriptUrl, String url)
      throws IOException, XPathExpressionException, SAXException, ParserConfigurationException {
    try {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder parser = factory.newDocumentBuilder();
      parser.setEntityResolver(new EntityResolver() {
        public InputSource resolveEntity(String publicId, String systemId)
            throws SAXException, IOException {
          // do not any resource resolving
          return new InputSource(new StringReader(""));
        }
View Full Code Here

    documentBuilderFactory.setCoalescing(true);
    documentBuilderFactory.setIgnoringComments(true);
    try
    {
      DocumentBuilder db = documentBuilderFactory.newDocumentBuilder();
      db.setEntityResolver(new EntityResolver()
      {
        public InputSource resolveEntity(String publicId, String systemId)
          throws SAXException
        {
          if (systemId.equals("http://java.sun.com/dtd/properties.dtd"))
View Full Code Here

TOP

Related Classes of org.xml.sax.EntityResolver

Copyright © 2018 www.massapicom. 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.