Recently there was a discussion here about programming Manakin aspects
in XSLT. I thought I'd post here a small example of something I did here
to show how it can be done. I wanted to add a breadcrumb to the
breadcrumb trail (so that the first breadcrumb in the trail is the
University Library, with our DSpace repository as the second
breadcrumb).
I created a folder called "Trail" in the "aspects" folder, and added a
reference to it in the xmlui.xconf, after all the other aspects:
<!-- this aspect adds VUW Library to the root of the breadcrumb trail
-->
<aspect name="Trail" path="Trail/"/>
In the "Trail" folder I have two files: a sitemap and a simple XSLT:
Here's the sitemap of my new Aspect:
<?xml version="1.0"?>
<!--
The Trail Aspect is responsible for modifying the breadcrumb trail
-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
<map:pipeline>
<map:generate/>
<map:transform src="modify-trail.xsl"/>
<map:serialize type="xml"/>
</map:pipeline>
</map:pipelines>
</map:sitemap>
And here is the modify-trail.xsl XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dri="http://di.tamu.edu/DRI/1.0/">
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="dri:pageMeta">
<xsl:copy>
<xsl:copy-of select="@*"/>
<dri:trail
target="http://www.victoria.ac.nz/library/">Library</dri:trail>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
I hope someone finds this helpful!
--
Conal Tuohy
New Zealand Electronic Text Centre
www.nzetc.org
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech