|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Search XML using XSL
thei wrote:
> It's just occurred to me that I should be able to use XSL to search an
> XML file, so I played around with things like contains(), but then
> realised I can't search more than one XML file or with more than one
> search term so I thought I'd ask here.
>
> I'd like to be able to search a set of XML files for "word1 word2" and
> have all elements that contain both "word1" and "word2" in any order
> returned. Or even just in that exact order. I can't work out how to
> search more than one XML file at a time.
Investigate the use of document('foo.xml') to get the root node of an
arbitrary XML document, when given the document's URI. You can put the URIs in
elements in a separate document and iterate over them with for-each. Note that
every document you access via document() will be loaded into memory and most
likely kept there for the duration of processing, so XSLT is not ideal for
this job if you have many or large XML docs. You should look into writing a
SAX application. It'll be much faster and more efficient, but you will have to
get your hands dirty with lower-level programming.
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








