Package com.microstar.xml

Examples of com.microstar.xml.XmlParser


            try {
              InputStream inStream = new GZIPInputStream(new FileInputStream(file));
                BufferedReader in = new BufferedReader(new InputStreamReader(inStream, Constantes.ASI_ENCODING));

                ASIHandler handler = new ASIHandler();
                XmlParser parser = new XmlParser();
                parser.setHandler(handler);
                try {
                    parser.parse(null, null, in);
                } catch (XmlException e) {
                    System.err.println(e);
                } catch (Exception e) {
                    // Should NEVER happend !
                    e.printStackTrace();
View Full Code Here


  {
    //String docURL = makeAbsoluteURL(url);
   
    // create the parser
    // System.out.println("File: "+xr.aFile.toString());
    XmlParser parser = new XmlParser();
    parser.setHandler(this);
    parser.parse(null, null, xr.diStream);
  }
View Full Code Here

  {
    //String docURL = makeAbsoluteURL(url);

        // create the parser
   // System.out.println("File: "+xr.aFile.toString());
    XmlParser parser = new XmlParser();
    parser.setHandler(this);
    parser.parse(null, null, xr.diStream);
  }
View Full Code Here

  if (xi == null) try {
    xi = getClass().getResourceAsStream(xs); // e.g. get from jar file
  } catch (Throwable e) {xi = null;}
  if (xi != null) {
    InputStreamReader xr = new InputStreamReader(xi);
    XmlParser parser = new XmlParser();
    parser.setHandler(this);
    parser.parse(null, null, xr);
  }
  }
View Full Code Here

    throws java.lang.Exception
  {
    //String docURL = makeAbsoluteURL(url);

        // create the parser
    XmlParser parser = new XmlParser();
    parser.setHandler(this);
    parser.parse(null, null, xr.diStream);
  }
View Full Code Here

    public void parse(Reader reader, MultipageModel multi)
            throws java.lang.Exception {
        _multi = multi;

        // create the parser
        _parser = new XmlParser();
        _parser.setHandler(this);
        _parser.parse(null, null, reader);
    }
View Full Code Here

            pubString = "";
        }

        _document = document;
        _root = null;
        _parser = new XmlParser();
        _document._parser = _parser;
        reset();

        try {
            _parser.setHandler(new Handler());
View Full Code Here

     */
    public void processingInstruction(String target, String data)
            throws Exception {
        if (target.equals("moml")) {
            StringReader dataReader = new StringReader(data);
            XmlParser newParser = new XmlParser();
            ConfigXmlHandler newHandler = new ConfigXmlHandler(
                    getCurrentTree(), getSystemId(), _includedClasses);
            newHandler.addExcludedFiles(_excludedFiles);
            newParser.setHandler(newHandler);
            newParser.parse(getSystemId(), null, dataReader);
            dataReader.close();
        }
    }
View Full Code Here

     *   constructed XML tree to be the "backtrack" node.
     *  @exception Exception If error occurs.
     */
    public void parseConfigFile(String fileName, Set<String> includedClasses,
            boolean backtrackingElement) throws Exception {
        XmlParser parser = new XmlParser();
        BufferedReader br = new BufferedReader(new FileReader(fileName));
        ConfigXmlHandler handler = new ConfigXmlHandler(_xmlTree, fileName,
                includedClasses);
        handler.addExcludedFiles(_excludedFiles);
        parser.setHandler(handler);
        try {
            // This fails to parse gtLibrary because it goes into a loop,
            // and causes a stack overflow, so we catch Throwable and
            // throw an exception.
            parser.parse(fileName, null, br);
        } catch (Throwable throwable) {
            throw new Exception("Failed to parse \"" + fileName + "\"",
                    throwable);
        }
        // Manually add a <group> element to the root of the tree.
View Full Code Here

        Reader buffered = new BufferedReader(reader);

        try {
            // We allocate a new XmlParser each time so as to avoid leaks.
            _xmlParser = new XmlParser();
            _xmlParser.setHandler(this);
            if (base == null) {
                _xmlParser.parse(null, null, buffered);
            } else {
                // If we have tmp.moml and tmp/tmp2.moml and tmp.moml
View Full Code Here

TOP

Related Classes of com.microstar.xml.XmlParser

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.