Package javax.xml.parsers

Examples of javax.xml.parsers.SAXParserFactory.newSAXParser()


    protected static final XMLReader getXMLReader(DocumentTableBuilder handler) throws Exception {
        final XMLReader myReader;

        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setNamespaceAware(true);
        SAXParser parser = factory.newSAXParser();
        myReader = parser.getXMLReader();

        // setup handlers (requires saxHandler)
        myReader.setContentHandler(handler);
        myReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
View Full Code Here


  protected static void parseNew(InputStream in, Channel ch, devplugin.Date day,
      Hashtable<String, MutableChannelDayProgram> ht, SweDBTvDataService dataService) throws Exception {
    SAXParserFactory fac = SAXParserFactory.newInstance();
    fac.setValidating(false);
    SAXParser sax = fac.newSAXParser();
    InputSource input = new InputSource(in);
    input.setSystemId(new File("/").toURI().toURL().toString());
    sax.parse(input, new DataHydraDayParser(ch, ht, dataService));
  }
View Full Code Here

   */
  public void parse(Reader cfgReader, String cfgName) throws Exception {
    this.joramAdmName = cfgName;

    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser parser = factory.newSAXParser();
    parser.parse(new InputSource(cfgReader), this);
  }

  /**
   * Handles notification of a non-recoverable parser error.
View Full Code Here

    this.configName = cfgName;

    a3cmlConfig = new A3CMLConfig();

    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser parser = factory.newSAXParser();
    parser.parse(new InputSource(cfgReader), this);

    return a3cmlConfig;
  }
View Full Code Here

        spf.setValidating(true);
        XMLReader reader = null;

    // set the features on the parser
    try{
          SAXParser parser = spf.newSAXParser();
          parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$ //$NON-NLS-2$
          parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", nameSpaceMap.keySet().toArray())//$NON-NLS-1$
          reader = parser.getXMLReader();
    } catch (SAXException err) {
            throw new TeiidComponentException(err);
View Full Code Here

       HashMap nameSpaceMap = new HashMap();
       SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setNamespaceAware(true);
        SAXParser parser;
        try {
            parser = spf.newSAXParser();
        } catch (ParserConfigurationException err) {
            throw new TeiidException(err);
        } catch (SAXException err) {
            throw new TeiidException(err);
        }
View Full Code Here

          "utf-8"
        ));
        out.println("<UriTests>");
       
        InputStream in = TestCreator.class.getClassLoader().getResourceAsStream("com/hp/hpl/jena/iri/test/uris.xml");
            fact.newSAXParser().parse(in,
            new TestCreator()
            );

       out.println("</UriTests>");
       in.close();
View Full Code Here

    static TestSuite suitex() throws SAXException, IOException, ParserConfigurationException {
        SAXParserFactory fact = SAXParserFactory.newInstance();
        TestSuite result = new TestSuite();
        result.setName("More IRI Tests");
        InputStream in = TestCreator.class.getClassLoader().getResourceAsStream("com/hp/hpl/jena/iri/test/test.xml");
            fact.newSAXParser().parse(in,
            new TestReader(result)
            );

       in.close();
       return result;
View Full Code Here

    public void parse(ServletContext servletContext)
        throws Exception {
      SAXParserFactory factory = SAXParserFactory.newInstance();
      factory.setNamespaceAware(false);
      factory.setValidating(false);
      SAXParser parser = factory.newSAXParser();
      servletContext.getContextPath();
      InputStream resourceAsStream = null;
      try {
        resourceAsStream = new FileInputStream(servletContext
            .getRealPath("WEB-INF/web.xml"));
View Full Code Here

    public Set<String> doParse() throws Exception {
      XmlHandler handler = new XmlHandler();
      SAXParserFactory factory = SAXParserFactory.newInstance();
      factory.setNamespaceAware(false);
      factory.setValidating(false);
      SAXParser parser = factory.newSAXParser();
      URL confURL = EntityManagerFactoryHolder.class.getClassLoader()
          .getResource("META-INF/persistence.xml");
      parser.parse(confURL.toString(), handler);
     
      return handler.getUnits();
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.