3 # $Id: abs2dom,v 1.3 2007-12-17 12:38:57 sondberg Exp $
4 # ----------------------------------------------------------------------------
5 # Generate a dom-filter indexing stylesheet based upon an .abs file
6 # Should be called either this way
8 # abs2dom something.abs > something.xsl
10 # or in a streaming way
12 # something | abs2dom > something.xsl
14 # The output xslt stylesheet generally needs a little bit of tweaking to be
15 # ready for indexing. In particular, watch out for the precedence rules of
16 # xslt templates which work differently from xelm declarations in an .abs file!
24 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
25 xmlns:z="http://indexdata.com/zebra-2.0"
28 <xsl:output indent="yes"
33 <xsl:template match="/">
35 <xsl:apply-templates/>
46 next unless s/^xelm\s+//;
47 my ($index) = (/(\S+)$/);
50 my @indexes = split /,/, $index;
52 print " <xsl:template match=\"$xpath\">\n";
53 print " <z:index name=\"", join(" ", @indexes), "\">\n";
54 print " <xsl:value-of select=\".\"/>\n";
55 print " </z:index>\n";
56 print " </xsl:template>\n\n";
60 print "</xsl:stylesheet>\n";