SSAX seeds help (and parse problems with entities)

Tobias Gerdin <[email protected]> Thu, 4 Jan 2007 19:24:02 +0100
Newsgroups gmane.lisp.scheme.ssax-sxml
Message-ID <[email protected]>
Hi,

I'm trying to figure out how to use the ssax:make-parser macro in a  
nice way. The functional "seed"-based approach is new to me but it I  
seems nice assuming that I could get the hang of it. My problem is  
very simple: I have a very large document essentially containing a  
list of entries (represented as <entry> ... </entry> tags, but with  
lots of nested tags inside). Inside each entry I want to extract two  
CDATA sections, namely the content in a <keb> element and a <gloss>  
element (in particular, I want to parse this file: ftp:// 
ftp.monash.edu.au/pub/nihongo/JMdict.gz, more information the  
document is found at http://www.csse.monash.edu.au/~jwb/j_jmdict.html).

I've done some experimenting but haven't found any nice solution to  
this elementary problem. Since the document is quite large (39MB) I  
don't think I'd like the seed to contain information on the two tags  
from all the entries, instead I'd thought that for each entry I'd  
pass the information (the two CDATA sections) to another procedure  
that inserts it into another data structure, and then reset the seed  
for the next entry.

So, to some it up: How do I extract CDATA sections from arbitrary  
tags in a nice way? I've been looking for example code but haven't  
found anything similiar to this.

On another note, when applied to the above document, the parser  
complains about entities of the style <pos>&n;</pos>:
([wf-entdeclared] broken for  n)

Any ideas?


Regards,

Tobias Gerdin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV