Hi!<br><br>I'm working on a xml parser that inserts data into a sqlite db. The program looks something like this:<br><br>(insert-into-db (get-name doc num) (get-xml doc num))<br><br>where get-name looks like this:<br><br>
(define (get-name doc num)<br> (srl:sxml->xml<br> ((sxpath "tag/tag2[$i]/tag3/name/text()")<br> (sxml:document doc)<br> '[(i . num)])))<br><br>and get-xml looks like this:<br><br>(define (get-xml doc num)<br>
(srl:sxml->xml<br> ((sxpath "tag/tag2[$i]")<br> (sxml:document doc)<br> '[(i . num)]))<br><br>where the xml document looks something like this:<br><br><?generic xml define..><br><some css><br>
</css><br><tag><br><tag2>...<tag3>name<tag3><tag2><br><tag2>...<tag3>name2<tag3><tag2><br>...<br><tag><br><br>It's suposed to insert the name thats found in every <tag2> and the whole <tag2> xml string into the database.<br>
<br><br>This turned out to be realy slow when I have a some xml document with a few thousand lines of declarations, it parses the document with one line per second (and yes, I know it's because it opens up the xml file everytime when it look up something.<br>
But like the newbe that I am I can't come up with any working design to make it faster. I have looked inte sxml-match and it looks promisin but I don't realy know how to use it in this project. Does anybody have an idea on how to do this a bit faster?<br>
<br>Kind regards M.<br>