Examples of SAXParser


Examples of javax.xml.parsers.SAXParser

  public SAXParser createParser()
  {
    try
    {
      SAXParserFactory parserFactory = createSAXParserFactory();
      SAXParser parser = parserFactory.newSAXParser();
      configureParser(parser);
      return parser;
    }
    catch (SAXException e)
    {

Examples of javax.xml.parsers.SAXParser

                    pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
                }
                catch (SAXException e) {}
            }
           
            SAXParser saxparser = pfactory.newSAXParser();
            parent = saxparser.getXMLReader();
        }
        catch (ParserConfigurationException e) {
            throw new SAXException(e);
        }
        catch (FactoryConfigurationError e) {

Examples of javax.xml.parsers.SAXParser

     */
    private ObjectHandler getHandler() {
        if ( handler == null ) {
            SAXParserFactory factory = SAXParserFactory.newInstance();
            try {
                SAXParser parser = factory.newSAXParser();
                handler = new ObjectHandler( this, getClassLoader() );
                parser.parse( in, handler );
            }
            catch ( ParserConfigurationException e ) {
                getExceptionListener().exceptionThrown( e );
            }
            catch ( SAXException se ) {

Examples of javax.xml.parsers.SAXParser

    private Map<String, Method> attributesMap = new HashMap<String, Method>();
   
    boolean isTest = false;
   
    public static void main(String[] args) throws Exception {
        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
        String input = "../html-codegen/html4-doc.xml";
        CanvasMethodsGenerator gen = new CanvasMethodsGenerator();
        if (args.length > 0) {
            gen.isTest = args[0].equals("t");
        }
        p.parse(new File(input), gen);
        gen.exportMethods();
    }

Examples of javax.xml.parsers.SAXParser

        }
        gen.exportMethods();
    }
   
    protected void parse(String inputFilename) throws Exception {
        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
        p.parse(new File(inputFilename), this);
    }

Examples of javax.xml.parsers.SAXParser

        sw.write(">\n");
        this.writeContentsOn(is, sw);
        sw.write("\n</");
        sw.write("rs");
        sw.write('>');
        SAXParser p = SAXParserFactory.newInstance().newSAXParser();
        try {
            p.parse(new ByteArrayInputStream(sw.toString().getBytes()), this);
            TRANSLATIONS_OK++;
            TRANSLATIONS_LINECOUNT += this.countLinesIn(out.toString());
        } catch (org.xml.sax.SAXParseException sax) {
            TRANSLATIONS_FAILED++;
            int column = sax.getColumnNumber();

Examples of javax.xml.parsers.SAXParser

      return valid;
   }

   private static void parse(InputStream xmlIs, final EntityResolver resolver)
   {
      SAXParser parser;
      try
      {
         parser = FACTORY.newSAXParser();
      }
      catch (Exception e)
      {
         throw new IllegalStateException("Failed to instantiate a SAX parser: " + e.getMessage());
      }

      try
      {
         parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/schema", true);
      }
      catch (SAXException e)
      {
         throw new IllegalStateException("Schema validation feature is not supported by the parser: " + e.getMessage());
      }

      try
      {
         parser.parse(xmlIs, new DefaultHandler()
         {
            public void warning(SAXParseException e)
            {
            }

Examples of javax.xml.parsers.SAXParser

    }
   
    public static void parseFile(File file) throws ParserConfigurationException, SAXException, IOException {
        XMLPropertiesHandler handler;
        SAXParserFactory factory;
        SAXParser parser;
       
        handler = new XMLPropertiesHandler();
        factory = SAXParserFactory.newInstance();
        parser = factory.newSAXParser();
        parser.parse(file, handler);
    }

Examples of javax.xml.parsers.SAXParser

    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
   
    boolean validating = JRProperties.getBooleanProperty(JRProperties.EXPORT_XML_VALIDATION);   
    saxParserFactory.setValidating(validating);

    SAXParser saxParser = saxParserFactory.newSAXParser();
    //XMLReader xmlReader = XMLReaderFactory.createXMLReader();
    XMLReader xmlReader = saxParser.getXMLReader();

    xmlReader.setFeature("http://xml.org/sax/features/validation", validating);

    JRXmlDigester digester = new JRXmlDigester(xmlReader);
    digester.push(this);

Examples of javax.xml.parsers.SAXParser

        parserFactory.setNamespaceAware(true);

        // Now create a SAXParser object
        ArrayList<BibtexEntry> bibItems = null;
        try {
            SAXParser parser = parserFactory.newSAXParser(); // May throw
            // exceptions
            MedlineHandler handler = new MedlineHandler();
            // Start the parser. It reads the file and calls methods of the
            // handler.
            parser.parse(stream, handler);

            // Switch this to true if you want to make a local copy for testing.
            if (false) {
                stream.reset();
                FileOutputStream out = new FileOutputStream(new File("/home/alver/ut.txt"));
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.