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

Anyone knows of an autocompleting SAX parser or filter

Subject: Anyone knows of an autocompleting SAX parser or filter?
From: Gunther Schadow <gunther@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Mar 2003 12:29:30 -0500
sax parsing stack
Hi,

sometimes I transform large files and it takes long. What I then do
is to take a snapshot of the XML output and load it into a text
editor, cut incomplete tails off at a suitable point and then close
all open tags. Then I can forward this file to other transforms.

Wouldn't it be nice if one could tell the SAX Parser (i.e. aelfred)
that instead of throwing all hands up if the file ends prematurely,
close all open tags and finish the file gracefully? Is there
such a thing?

Since I am a disciple of Aelfred and Saxon I am most interested in
a generic solution (not one that would ask me to migrate so some
other parser). I could imagine a little SAX filter that would
receive events from an upstream parser and keep a simple stack of
open elements. Then if it receives a SAXParserException from the
upstream parser, it will simply pop the elements to close from the
stack and produce endElement events from those.

Simple enough that I will eventually just do it. But has anybody
done it already?

thanks,
-Gunther

PS: and no, I do not care whether the result document conforms to
some schema or whether there may be broken forward references in
the data. All I want is a well-formed output.

--
Gunther Schadow, M.D., Ph.D.                    gschadow@xxxxxxxxxxxxxxx
Medical Information Scientist      Regenstrief Institute for Health Care
Adjunct Assistant Professor        Indiana University School of Medicine
tel:1(317)630-7960                         http://aurora.regenstrief.org



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.