Package net.n3.nanoxml

Examples of net.n3.nanoxml.XMLWriter


            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


  public void load(Reader rdr, ClassLoader cl) throws XMLException
  {
    try
    {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      parser.setReader(new StdXMLReader(rdr));
      IXMLElement element = (IXMLElement) parser.parse();
      // Bug 2942351 (Program doesn't launch)
      // looking at the source for StdXMLBuilder, it appears that parser.parse() could possibly return
      // null.  So check for null here and skip if necessary.
      if (element != null)
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

    private XMLElement loadXML(final File file) throws ConfigureException {
        try {
            final FileReader r = new FileReader(file);
            try {
                StdXMLReader xr = new StdXMLReader(r);
                IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
                parser.setReader(xr);
                return (XMLElement) parser.parse();
            } finally {
                r.close();
View Full Code Here

     * @return a TestSetSpecification holding everything parsed.
     * @throws Exception
     */
    public TestSetSpecification parse(TestHarness harness, InputStream in, String base)
        throws Exception {
        StdXMLReader xr = new StdXMLReader(in);
        IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
        parser.setReader(xr);
        TestSetSpecification res;
        IXMLElement root = (IXMLElement) parser.parse();
        if (root.getName().equals("testSpec")) {
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();

        // extract the spec to this specific panel instance
View Full Code Here

      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 {
View Full Code Here

      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) {
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();

        // extract the spec to this specific panel instance
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.