Examples of SAXParserFactory


Examples of com.liferay.faces.util.xml.SAXParserFactory

    // Obtain a ResourceReader that is compatible with a startup ExternalContext
    ResourceReader resourceReader = newResourceReader();

    // Obtain a SAX Parser Factory.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
    saxParserFactory.setValidating(false);
    saxParserFactory.setNamespaceAware(true);

    try {

      // Obtain a SAX Parser from the factory.
      SAXParser saxParser = saxParserFactory.newSAXParser();

      // Scan all the web.xml and web-fragment.xml descriptors in the classpath.
      WebConfigScanner webConfigScanner = newWebConfigScanner(classLoader, resourceReader, saxParser,
          resolveEntities);
      WebConfig webConfig = webConfigScanner.scan();
View Full Code Here

Examples of javax.xml.parsers.SAXParserFactory

    }

    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

Examples of javax.xml.parsers.SAXParserFactory

  public void warning(SAXParseException e) {
  }

  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

Examples of javax.xml.parsers.SAXParserFactory

   * Launches the XML parser.
   */
  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);
  }
View Full Code Here

Examples of javax.xml.parsers.SAXParserFactory

                           String cfgName) throws Exception {
    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

Examples of javax.xml.parsers.SAXParserFactory

      addWarning(me);
      nameSpaceMap = new HashMap();
    }
   
    // Create a SAXParser
    SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setNamespaceAware(true);
        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

Examples of javax.xml.parsers.SAXParserFactory

     * @throws ParserConfigurationException
     * @throws IOException
     */
     private HashMap getTargetNameSpaces(Collection<SQLXML> schemas) throws TeiidException {
       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

Examples of javax.xml.parsers.SAXParserFactory

    static final Class attSign[] = new Class[] { Attributes.class };
    static final Class nullSign[] = new Class[] { };

    static PrintWriter out;
    static void load() throws SAXException, IOException, ParserConfigurationException {
        SAXParserFactory fact = SAXParserFactory.newInstance();
        out = new PrintWriter(new OutputStreamWriter(
          new FileOutputStream("src/com/hp/hpl/jena/iri/test/test.xml"),
          "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

Examples of javax.xml.parsers.SAXParserFactory

    IRI computeIRI() {
        throw new UnsupportedOperationException();
    }

    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

Examples of javax.xml.parsers.SAXParserFactory

      return sessionTimeout;
    }

    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
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.