diff options
Diffstat (limited to 'convert-style-to-html.xsl')
-rw-r--r-- | convert-style-to-html.xsl | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/convert-style-to-html.xsl b/convert-style-to-html.xsl index dbc7281..b22de5c 100644 --- a/convert-style-to-html.xsl +++ b/convert-style-to-html.xsl @@ -1,62 +1,48 @@ <?xml version="1.0" encoding="UTF-8"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:str="http://exslt.org/strings" + extension-element-prefixes="str"> <xsl:output method="xml" indent="yes" encoding="UTF-8" /> - <xsl:include href="util.xsl"/> - <!-- Convert endnote style definitions declarations to html tags --> <!-- TODO: <author>Editors,</author> bzw <author>Editor,</author> --> <xsl:template match="style" name="style"> - <xsl:param name="oldface" select="@face"/> - <xsl:param name="exclude" select="''" /> - - <xsl:variable name="face"> - <xsl:call-template name="string-replace-all"> - <xsl:with-param name="text" select="$oldface" /> - <xsl:with-param name="replace" select="$exclude" /> - <xsl:with-param name="by" select="''" /> - </xsl:call-template> - </xsl:variable> + <xsl:param name="face" select="@face"/> <xsl:choose> <xsl:when test="contains($face, 'subscript')"> <sub> <xsl:call-template name="style"> - <xsl:with-param name="oldface" select="$face"/> - <xsl:with-param name="exclude" select="'subscript'"/> + <xsl:with-param name="face" select="str:replace($face, 'subscript', '')"/> </xsl:call-template> </sub> </xsl:when> <xsl:when test="contains($face, 'superscript')"> <sub> <xsl:call-template name="style"> - <xsl:with-param name="oldface" select="$face"/> - <xsl:with-param name="exclude" select="'superscript'"/> + <xsl:with-param name="face" select="str:replace($face, 'superscript', '')"/> </xsl:call-template> </sub> </xsl:when> <xsl:when test="contains($face, 'italic')"> <em> <xsl:call-template name="style"> - <xsl:with-param name="oldface" select="$face"/> - <xsl:with-param name="exclude" select="'italic'"/> + <xsl:with-param name="face" select="str:replace($face, 'italic', '')"/> </xsl:call-template> </em> </xsl:when> <xsl:when test="contains($face, 'boldface')"> <strong> <xsl:call-template name="style"> - <xsl:with-param name="oldface" select="$face"/> - <xsl:with-param name="exclude" select="'boldface'"/> + <xsl:with-param name="face" select="str:replace($face, 'bold', '')"/> </xsl:call-template> </strong> </xsl:when> <xsl:when test="contains($face, 'normal')"> <xsl:call-template name="style"> - <xsl:with-param name="oldface" select="$face"/> - <xsl:with-param name="exclude" select="'normal'"/> + <xsl:with-param name="face" select="str:replace($face, 'normal', '')"/> </xsl:call-template> </xsl:when> |