[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XML Parsing - a slightly different approach.


keean schupke
Hi,

	I just read through a pair of articles on XML (XML is too hard for
programmers, and Why XML doesn't [expletive deleted]), and thought you might be interested
in a different approach. I have recently needed an XML parser that is
capable of parsing seriously huge amounts of data (machines with half a gig
of memory would regularly fall over from the weight of the tree). I too
share a dislike of callbacks with the author of the piece, but I was using a
different language and so the solution is invariably different (I was using
the lazy-functional language, Haskell). In a lazy functional language a list
is like a stream or FIFO (but with no special syntax for the programmer) -
This means that if you represent the DOM as a list of elements with their
respective tree depths, the parser can stream the DOM out, (the
imlementation does not stop on a non-compliance, rater it anotates the error
as meta-data to the DOM and continues - allowing the application to choose
if the condition is fatal). You can write filters to extract the data very
simply, and combine filters using function-composition, or a Monad. The
whole assembly uses very little memory as the data is effectively streamed
through the composed filters, with the tree stucture is encoded in the depth
information. I am not sure if this model could be applied to
non-lazy-functional languages without loosing a lot of the benefits, it
would certainly work for simple filters, but without the ability to use
function composition on the filters to create more complex filters, it may
be not as useful. (I appreciate this description is rather terse, and am
willing to provide more datail should anyone be interested...)

	Regards,
	Keean Schupke, ACGI BEng MIEE,
	Computer Support Group,
	Department of Electrical & Electronic Engineering,
	Imperial College London.


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.