[jdom-interest] Suggestion Required ( a newbie question)

daniele rizzi daniele.rizzi at ls.largesys.it
Thu Dec 6 01:54:36 PST 2001

Hash: SHA1

Dear all,

I'm rather fresh on xml so I'm trying to gather some suggestion
on some code I'd like to write:

I've got a master-detail data structure that lends itself to 
a 'table-into-table' pattern; I'm talking about a collection of 
books, mapped into a sql table (1 book - 1 record).
Any book has also a read-only table of content, which is 
now modeled in a detail table but perhaps could be housed
in the master table in a clob as:

<toc><line id="1">hello</line><line id="2">second line</line></toc>

(for read-only, I mean that the application just queries it and
not updating in any way)

So far, so good: the point is that queries are done via a full-text
engine, which return the book record and a (position, lenght) pair
for the match, that is:

query HELLO: -> record matched at (25,5) (and perhaps further down...)

QUESTION (finally...):

at the end of the line, I receive a String containing the whole xml-toc
and the matched pairs; I'd like to find out what <line> matched but
the query engine is not telling me:

- -I may parse xml-toc and iterating thru the lines but the matched pairs
have no meaning in that context;
- - or I could mark up the xml-toc (ie with <b></b>) and then parse, 
  in this case the xml is going to be invalid (not a xml-toc anymore);

Sounds like a chicken and egg situation; any suggestion?

daniele rizzi (drizzi at largesys.it) (sorry for the boring stuff)

Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>


More information about the jdom-interest mailing list