Examples of SAXParser


Examples of com.dotcms.repackage.javax.xml.parsers.SAXParser

        config = new ClickstreamConfig();

        try {
            Logger.debug(ConfigLoader.class, "Loading config");
            SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
            parser.parse(is, new ConfigHandler());
            return config;
        }
        catch (SAXException e) {
            Logger.fatal(ConfigLoader.class, "Could not parse config XML", e);
            throw new RuntimeException(e.getMessage());

Examples of com.dotcms.repackage.org.cyberneko.html.parsers.SAXParser

    public void parse(InputSource is, ContentHandler consumer)
            throws IOException, SAXException {
        if (is == null)
            throw new NullPointerException("is argument is required.");

        SAXParser parser = new SAXParser();
        parser.setFeature("http://xml.org/sax/features/namespaces", true);
        parser
                .setFeature(
                        "http://cyberneko.org/html/features/override-namespaces",
                        false);
        parser.setFeature(
                "http://cyberneko.org/html/features/insert-namespaces", false);
        parser
                .setFeature(
                        "http://cyberneko.org/html/features/scanner/ignore-specified-charset",
                        true);
        parser.setProperty(
                "http://cyberneko.org/html/properties/default-encoding",
                "UTF-8");
        parser.setProperty("http://cyberneko.org/html/properties/names/elems",
                "lower");
        parser.setProperty("http://cyberneko.org/html/properties/names/attrs",
                "lower");

        parser.setContentHandler(new RemoveNamespacesHandler(
                new MergeCharacterEventsHandler(consumer)));
        parser.parse(is);
    }

Examples of com.sun.org.apache.xerces.internal.parsers.SAXParser

    {
      // Fallback if this fails (implemented in createIncrementalSAXSource) is
      // to attempt Xerces-1 incremental setup. Can't do tail-call in
      // constructor, so create new, copy Xerces-1 initialization,
      // then throw it away... Ugh.
      IncrementalSAXSource_Xerces dummy=new IncrementalSAXSource_Xerces(new SAXParser());
      this.fParseSomeSetup=dummy.fParseSomeSetup;
      this.fParseSome=dummy.fParseSome;
      this.fIncrementalParser=dummy.fIncrementalParser;
    }
  }

Examples of com.sun.org.apache.xerces.internal.parsers.SAXParser

    catch(NoSuchMethodException e)
    {
      // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
      // Fall back on filtering solution.
      IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
      iss.setXMLReader(new SAXParser());
      return iss;
    }
  }

Examples of com.volantis.xml.xerces.parsers.SAXParser

     */
    private StyleCategory[] readCategories()
        throws Exception {

        // Get an XML reader
        final XMLReader reader = new SAXParser();

        // Construct an entity resolver that looks in the JAR that
        // contains the same class as this class, and use it to look
        // up the XML file
        final JarFileEntityResolver resolver = new JarFileEntityResolver(this);
        // add the mapping for the style-catorgories.xml file.
        resolver.addSystemIdMapping(
            STYLE_CATEGORIES_XML_URI,
            STYLE_CATEGORIES_XML_LOCATION);
        // add the mapping for the style-catorgories.xsd file.
        resolver.addSystemIdMapping(
            STYLE_CATEGORIES_SCHEMA_URI,
            STYLE_CATEGORIES_SCHEMA_LOCATION);

        final InputSource xmlInputSource =
            resolver.resolveEntity(null, STYLE_CATEGORIES_XML_URI);

        // Create a content handler and attach it to the reader
        final StyleCategoryContentHandler handler =
            new StyleCategoryContentHandler();
        reader.setContentHandler(handler);
        reader.setErrorHandler(handler);
        reader.setEntityResolver(resolver);

        // Turn on schema validation
        reader.setFeature(
            "http://apache.org/xml/features/validation/schema", true);

        // Parse the XML file
        reader.parse(xmlInputSource);

        // Get the categories from the content handler
        final List catsList = handler.getStyleCategories();
        StyleCategory[] catsArray = new StyleCategory[catsList.size()];
        return (StyleCategory[])

Examples of javax.xml.parsers.SAXParser

              throws ParserConfigurationException, SAXException, IOException {
        if (nmgr == null) {
            throw new RuntimeException("can't create a new Node without a NodeManager");
        }

        SAXParser parser = factory.newSAXParser();

        currentNode = null;

        parser.parse(file, this);

        return currentNode;
    }

Examples of javax.xml.parsers.SAXParser

               throws ParserConfigurationException, SAXException, IOException {
        if (helmaNode == null) {
            throw new RuntimeException("Can't create a new Node without a root Node");
        }

        SAXParser parser = factory.newSAXParser();

        rootNode = helmaNode;
        currentNode = null;
        convertedNodes = new HashMap();
        nodeStack = new Stack();
        parsingHopObject = true;

        parser.parse(in, this);

        return rootNode;
    }

Examples of javax.xml.parsers.SAXParser

    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);
        myReader.setFeature("http://xml.org/sax/features/validation", true);

Examples of javax.xml.parsers.SAXParser

/**
* Reads parameter values from whichever input method was specified
* in the constructor.
*/
public void read() throws Exception {
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    if (inFile != null)
  parser.parse(inFile, this);
    else if (inInputSource != null)
  parser.parse(inInputSource, this);
}

Examples of javax.xml.parsers.SAXParser

  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));
  }
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.