Hi Alan,
generally, XSLT is better for solving problems where an XML
document is processed completely and the outcome is more or
less the whole document in a redesigned manner.
XQuery is rather meant to pick selected data items from a
file and present these in a form that does not have anything
to do with the original arrangement.
From a first glance your problem seems to require two passes
anyway. In a first pass, select all the big XML’s text nodes
that are represented in a small file also and output these.
A second pass selects the non-represented ones.
Have you considered using first XQuery and lateron XSLT ?
XQuery can easily fetch all information in an appropriate
sequence of result-nodes:
text
position description
…
XSLT might use this information to print a nice report.
The precondition for all things using position descriptors
is that the files do not change between the passes.
With version 4.2 Tamino offers a technique to do this via
using the XSLT.transform output handler. So Tamino deals with
XQuery and a subsequent step uses an XSLT stylesheet for
presentation.
If you prefer using only one technology either will do. In
XQuery you must use two seperate for statements for running
through the texts, one for fetching the found-texts and one
fetching the non-found ones. In XSLT you probably need two
apply-templates in the template looping through text-nodes.
Regards,
Juliane.
#Tamino#API-Management#webMethods