On Tue, Feb 26, 2013 at 7:22 PM, Jose Blanco <email@example.com> wrote:
> I'm using discovery in 3.0 and find that the results page after a search is
> done which is rendered by discovery.xsl in dri2xhtml-alt (I'm using Mirage )
> does not have the mets file available. I have a whole bunch of xsl that
> relies on the mets files and don't want to re-write that. Is there a way to
> make the mets file available so I can use the xsl I already have when a
> search is done using discovery.
XSL files don't matter here. Templates in them are the important units. You can have templates matching either DRI (default) or the METS documents. There are some ready-made templates which match the specific METS document of an item, but that is not applicable when they're processing the DRI of, say, a community.
As a sidenote, XSL files are in no way tied to pages, either. You could have just one huge XSL file per theme and it could work the same.
In order to process each of the METS documents listed on a discovery page, you can use the document() with their METS document as the argument.
Take this page as an example:
You can see that the items in the list can be identified by their handle:
<list id="aspect.discovery.SimpleSearch.list.10673/598:dc.type" n="10673/598:dc.type">
So you can loop (for-each) all those elements, grab @n, extract the handle and construct the METS document URL, which has this form:
To grab a value from the METS document an display it, you would construct an XPath like this (off the top of my head, not tested):
<xsl:value-of select="document('http://demo.dspace.org/xmlui/metadata/handle/10673/598/mets.xml')/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/dim:field[@element='title']" />