simple XML for C++ application data-file I/O

David Megginson david at megginson.com
Mon Dec 6 13:51:12 GMT 1999


Paul Miller <stele at fxtech.com> writes:

> I've seen a lot of discussion about DOM, SAX, RDF, etc. but none of the
> solutions I've seen are very simple or straightforward for generic
> application data I/O (ie. non web, e-commerce, Java-type stuff). In
> other words, I'm about to roll my own, and would like to gauge interest
> in a small callback-based API for simple XML I/O.

We tried to keep SAX 1.0 as simple as possible -- how would you
simplify the following further?

  public static void main ()
  {
    Parser parser = new SomeSAXDriver();
    parser.setDocumentHandler(new MyHandler());
    try {
      parser.parse("http://www.foo.com/foo.xml");
    } catch (SAXException e) {
      // do something!!
    }
  }

and

  public class MyHandler extends HandlerBase
  {
    public void startElement (String name, AttributeList atts)
    {
      // do something!!
    }

    public void endElement (String name)
    {
      // do something!!
    }

    public void characters (char ch[], int start, int length)
    {
      // do something!!
    }
  }


All the best,


David

-- 
David Megginson                 david at megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list