xsl-list
[Top] [All Lists]

RE: Searching a group of xml documents

2003-07-14 07:11:28
Hi,

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-
list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
bmcleere(_at_)eircom(_dot_)net
Sent: Monday, July 14, 2003 6:11 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com

Hi all,

I need to search a repository/directory of xml documents. I want to search
each xml document for the contents of a tag called <identifier>.  The
contents of the tag would be as follows:

<identifier>Perl for Beginners</identifier>

When a match is found I want to display the contents of the <location> tag
in the selected document to the screen which would be a URL e.g.
<location>http://www.sometag.asp</location>

I know how to search one document and retrieve the data from it but need
help with more than one.

Any assistance would be greatly appreciated.

I would look at Jakarta Lucene for this purpose. Following is a brief
overview, since doing it this way is off-topic for the xsl-list.

You create an index by passing your content through a ContentHandler. Each
time you come across the desired elements you add the content as Field to
the document's indexed instance. 

After indexing your content you can run a query against it to get back a
List of Hits. You iterate through the Hits to get each Lucene Document
instance and then get the value of the Fields you identified in the
ContentHandler.

Best,
-Rob




Kindest regards,

Brenda



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



<Prev in Thread] Current Thread [Next in Thread>