[
Lists Home |
Date Index |
Thread Index
]
- To: xml-dev mailing list <xml-dev@lists.xml.org>
- Subject: Different parsing model/API
- From: Rich Salz <rsalz@datapower.com>
- Date: Mon, 03 Nov 2003 16:34:11 -0500
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507
Jef Poskanzer (of PBM, etc., fame) has an XML parsing model that I
haven't seen before. It basically returns you the element text, but
with the stack of pending elements along with it. It's amenable to
streaming, and avoids the common bookkeeping that SAX requires you to
do. Written in C++, some templates, BSD-style open source license. From
his header file:
// The idea here is to parse the document on the fly, like SAX, but the
// only type of data returned is text, i.e. the stuff between all the
// markup elements. The trick is that the text strings come with a list
// of elements attached (and each element has a (name,value) map of
// attributes). The parser keeps track of the stack of elements currently
// in effect, instead of making every application do it. Self-closing
// elements ("<foo bar=bletch /foo>") return an empty string with the
// element list attached.
See http://www.acme.com/software/XIP/ for the code.
/r$
--
Rich Salz, Chief Security Architect
DataPower Technology http://www.datapower.com
XS40 XML Security Gateway http://www.datapower.com/products/xs40.html
XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html
|