First I should note that I described the problem inside-out.  I needed
to index a set of metadata elements in the DRI document by an attribute
value from the METS document, not the other way around.  Just getting
that straight helped a lot.

On Thu, Apr 03, 2008 at 03:00:34PM -0500, Dorothea Salo wrote:
> On Thu, Apr 3, 2008 at 2:06 PM, Mark H. Wood <[EMAIL PROTECTED]> wrote:
> > Is there some good place to ask questions about XSLT in general?
> 
> Try the XSL mailing list Mulberry Technologies runs:
> <http://www.mulberrytech.com/xsl/xsl-list/>.

That led me to Dave Pawson's "XSLT Questions and Answers"
(http://www.dpawson.co.uk/xsl/sect2/sect21.html) which provided a
vital clue to what I was doing wrong.  I'm bookmarking both.
 
> > (In case this sounds interesting: in the item summary view I need to
> > relate each of the item's bitstreams to a metadata element my aspect
> > adds to the pageMeta element.
> 
> Just one metadata element, or one element per bitstream? If the
> former, I'd be tempted to chuck it into a variable.

One element per bitstream, but this hint led to a solution anyway --
thanks!  I used the match= expression from my busted key element as
the select= expression and assigned the set of relevant metadata
nodes to a variable, then for each bitstream I run through the node
set with for-each and pull out the text of the node with the attribute
value matching the bitstream's xlink:href.  A key or a direct
reference would have been nice, but it turns out that there is no way
to express either one in this case.

Why this was necessary: I see two ways that document() could work, and
nothing I've read (including the Recommendation!) explicitly says
which is correct.  One is to graft the new document into the existing
source tree, which naively made sense but on reflection probably
causes all sorts of problems, and in any case isn't the way it works.
The other way is for document() to create a new, separate source tree
and (apparently) push it onto a stack of partially-processed trees.
The various axes can only address within the current tree, so there
was no way for me to "see out of" the METS document to pluck values
from the (stacked) DRI document.  Variables exist independent of this
structure, so I could assign a set of the necessary nodes to a
variable and refer to it regardless of which node tree is being
processed.

The vital clue was noted by James Clark in the above-mentioned FAQ:
"/" identifies the root node of the *current document*.  This is
stated in the XPath Recommendation, but it would have taken me a long
time to get there.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is "intuitive" he
means the exact opposite.

Attachment: pgp2z3wAeAOCV.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to