This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
how to create an .xsl file to transform pidgin docbook
- From: "Robert P. J. Day" <rpjday at mindspring dot com>
- To: docbook apps list <docbook-apps at lists dot oasis-open dot org>
- Date: Tue, 18 Feb 2003 20:11:11 -0500 (EST)
- Subject: DOCBOOK-APPS: how to create an .xsl file to transform pidgin docbook
just in case anyone was interested, i threw together a script
that accepts pairs of element names and generates the appropriate
.xsl file that i use to tranform pidgin docbook to the real thing.
it *appears* to work, and you can see how easy it is to add
more transformations.
rday
#!/bin/sh
cat << EOF
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="@* | node()">
<xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy>
</xsl:template>
EOF
while read ELT ABB ; do
printf "<xsl:template match=\"$ABB\">\n"
printf " <$ELT>\n"
printf " <xsl:apply-templates select=\"@*|node()\"/>\n"
printf " </$ELT>\n"
printf "</xsl:template>\n"
printf "\n"
done <<EOF
chapter ch
section se
para p
title ti
emphasis em
filename fn
command cm
constant cn
replaceable re
varname vn
firstterm ft
programlisting pl
screen sc
userinput ui
prompt pr
lineannotation la
literallayout ll
itemizedlist il
orderedlist ol
listitem li
EOF
echo "</xsl:stylesheet>"