I just got the same idea but I was puzzled that one can put this
in the stylesheet. And if I do that I only get the value of the
"tex" entry. Not more not less.
The command line I use:
xsltproc -o test.tex ~/xml/tex.xsl doc.xml
The beginning of tex.xsl looks like this:
<?xml version='1.0' encoding="ISO-Latin-1"?>
<xsl:stylesheet
xmlns

sl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://db2latex.sourceforge.net/xsl/docbook.xsl"/>
<xsl:template match="eqn">
<equation>
<mediaobject>
<imageobject>
<imagedata fileref="{@image}"/></imageobject>
</mediaobject>
<alt role="tex"><xsl:value-of select="@tex"/></alt>
</equation>
</xsl:template>
I am not sure but in my understanding the
stylefile can only convert my xml-file into some other format. So the
"replacement" of the eqn should happen before using the style. Thus I
think one should do something like
<xsl:template match="eqn">
<xsl:text>\begin{equation}</xsl:text>
<alt role="tex"><xsl:value-of select="@tex"/></alt>
<xsl:text>\end{equation}</xsl:text>
</equation>
</xsl:template>
And adapt the style sheet for the html-output the same way. But this is not
very handy.
Thomas