|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Anyone knows of an autocompleting SAX parser or fi
I think a good way of doing this would be to write an STX transform as a preprocessing filter to the XSLT transform. STX is described at stx.sourceforge.net. It is an XSLT-like transformation language that processes a SAX stream serially, without building a tree. It is therefore very suitable for writing a filter that reduces the size of the tree that XSLT has to deal with. Michael Kay > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Gunther Schadow > Sent: 05 March 2003 17:30 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Anyone knows of an autocompleting SAX parser or filter? > > > 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 > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








