Package net.n3.nanoxml

Examples of net.n3.nanoxml.XMLWriter


    */
   public void parse(InputSource source)
      throws SAXException,
             IOException
   {
      IXMLParser parser = this.createParser();
      parser.setBuilder(this.adapter);
      parser.setResolver(this.entityResolver);
      Reader reader = source.getCharacterStream();

      if (reader != null) {
         parser.setReader(new StdXMLReader(reader));
      } else {
         InputStream stream = source.getByteStream();

         if (stream != null) {
            String encoding = source.getEncoding();

            if (encoding != null) {
               try {
                  reader = new InputStreamReader(stream, encoding);
                  parser.setReader(new StdXMLReader(reader));
               } catch (UnsupportedEncodingException exception) {
                  throw new SAXException(exception);
               }
            } else { // if encoding == null
               parser.setReader(new StdXMLReader(stream));
            }
         } else { // if stream == null
            parser.setReader(new StdXMLReader(source.getPublicId(),
                                              source.getSystemId()));
         }
      }

      try {
         parser.parse();
         this.adapter.endDocument();
      } catch (IOException exception) {
         throw exception;
      } catch (Exception exception) {
         throw new SAXException(exception);
View Full Code Here


    */
   public void parse(String systemId)
      throws SAXException,
             IOException
   {
      IXMLParser parser = this.createParser();
      parser.setBuilder(this.adapter);
      parser.setReader(new StdXMLReader(null, systemId));

      try {
         parser.parse();
         this.adapter.endDocument();
      } catch (IOException exception) {
         throw exception;
      } catch (Exception exception) {
         throw new SAXException(exception);
View Full Code Here

            log.debug(new String(out.toByteArray()));
        // #endif

        try {
            IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
            IXMLReader reader = StdXMLReader.stringReader(new String(out.toByteArray(), "UTF8")); //$NON-NLS-1$
            parser.setReader(reader);
            IXMLElement rootElement = (IXMLElement) parser.parse();

            if (!rootElement.getName().equalsIgnoreCase("multistatus")) //$NON-NLS-1$
                throw new IOException(Messages.getString("MultiStatusResponse.invalidDavRootElement") + rootElement.getName()); //$NON-NLS-1$
View Full Code Here

       try{
         try {
           IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
           // IXMLReader reader = StdXMLReader.fileReader(file); // fails on pc
           BufferedReader breader = new BufferedReader(new FileReader(file));
           IXMLReader reader = new StdXMLReader(breader);
           parser.setReader(reader);
           el = (XMLElement) parser.parse();
           if (el == null) {
             el = promptToOverwrite(xmlFile, tag);
           } else {
View Full Code Here

        ch = st.read();
      }
IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
Reader breader = new StringReader(xmlText);
IXMLReader reader = new StdXMLReader(breader);
parser.setReader(reader);
el = (XMLElement) parser.parse();
      return el;
    }
View Full Code Here

        }

        // initialize the parser
        StdXMLParser parser = new StdXMLParser();
        parser.setBuilder(new StdXMLBuilder());
        parser.setValidator(new NonValidator());
        parser.setReader(new StdXMLReader(input));

        // get the data
        data = (XMLElement) parser.parse();
View Full Code Here

        }

        // initialize the parser
        StdXMLParser parser = new StdXMLParser();
        parser.setBuilder(new StdXMLBuilder());
        parser.setValidator(new NonValidator());
        parser.setReader(new StdXMLReader(input));

        // get the data
        data = (XMLElement) parser.parse();
View Full Code Here

            return;
        }

        // initialize the parser
        StdXMLParser parser = new StdXMLParser();
        parser.setBuilder(new StdXMLBuilder());
        parser.setValidator(new NonValidator());
        parser.setReader(new StdXMLReader(input));

        // get the data
        data = (XMLElement) parser.parse();
View Full Code Here

            return;
        }

        // initialize the parser
        StdXMLParser parser = new StdXMLParser();
        parser.setBuilder(new StdXMLBuilder());
        parser.setValidator(new NonValidator());
        parser.setReader(new StdXMLReader(input));

        // get the data
        data = (XMLElement) parser.parse();
View Full Code Here

            haveSpec = false;
            return;
        }

        // initialize the parser
        StdXMLParser parser = new StdXMLParser();
        parser.setBuilder(new StdXMLBuilder());
        parser.setValidator(new NonValidator());
        parser.setReader(new StdXMLReader(input));

        // get the data
        data = (XMLElement) parser.parse();

        // extract the spec to this specific panel instance
        if (data.hasChildren())
        {
            specElements = data.getChildrenNamed(NODE_ID);
View Full Code Here

TOP

Related Classes of net.n3.nanoxml.XMLWriter

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.