X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fabs2dom;h=2daf657c8636f8eb0389ac847f813d270dfedbd7;hb=4097bac1dce126e79ce1550fad8b2034a311ff80;hp=fb20cdcf474318b7f6ca4141b5fd8b5d66159428;hpb=daca89243af359a79f23b69690d2b39aa6db9b67;p=idzebra-moved-to-github.git diff --git a/util/abs2dom b/util/abs2dom index fb20cdc..2daf657 100755 --- a/util/abs2dom +++ b/util/abs2dom @@ -1,20 +1,41 @@ #!/usr/bin/perl -w -# $Id: abs2dom,v 1.1 2007-12-17 11:48:14 sondberg Exp $ +# $Id: abs2dom,v 1.3 2007-12-17 12:38:57 sondberg Exp $ # ---------------------------------------------------------------------------- # Generate a dom-filter indexing stylesheet based upon an .abs file +# Should be called either this way +# +# abs2dom something.abs > something.xsl +# +# or in a streaming way +# +# something | abs2dom > something.xsl +# +# The output xslt stylesheet generally needs a little bit of tweaking to be +# ready for indexing. In particular, watch out for the precedence rules of +# xslt templates which work differently from xelm declarations in an .abs file! +# +# Good luck! use strict; -my $xslt_header = < +print < + + + + + + + + END_OF_XSLT @@ -23,9 +44,17 @@ while (<>) { s/^\s+//; s/\s+$//; next unless s/^xelm\s+//; - my ($indexes) = (/(\S+)$/); - s/\s+\Q$indexes\E$//; + my ($index) = (/(\S+)$/); + s/\s+\Q$index\E$//; my $xpath = $_; + my @indexes = split /,/, $index; - print "XPATH='$xpath', INDEX='$indexes'\n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n\n"; } + + +print "\n";