3 <!-- This maps any root element containing elements in the DC namespace to an index structure
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:pgterms="http://www.gutenberg.org/rdfterms/"
10 xmlns:z="http://indexdata.com/zebra-2.0"
11 exclude-result-prefixes="pgterms">
13 <!-- Extract sort keys in addition to word keys -->
14 <xsl:variable name="sort">|title|date|creator|</xsl:variable>
15 <!-- Extract phrase keys in addition to word keys -->
16 <xsl:variable name="phrase">|title|date|creator|</xsl:variable>
18 <xsl:output method="xml" indent="yes"/>
20 <xsl:template match="/ignore">
24 <xsl:template match="/*">
26 <xsl:apply-templates/>
28 <xsl:call-template name="special-indexes"/>
31 <z:index name="anywhere:w">
32 <xsl:value-of select="normalize-space()"/>
38 <xsl:template match="/*/*[namespace-uri() = 'http://purl.org/dc/elements/1.1/']">
39 <z:index name="any:w {local-name()}:w">
40 <xsl:value-of select="."/>
44 <xsl:template name="special-indexes">
45 <xsl:for-each select="/*/*">
46 <xsl:if test="contains($sort, local-name(.))">
47 <z:index name="{local-name(.)}:s">
48 <xsl:value-of select="."/>
51 <xsl:if test="contains($phrase, local-name(.))">
52 <z:index name="{local-name(.)}:p">
53 <xsl:value-of select="."/>
59 <xsl:template match="text()"/>