diff options
-rw-r--r-- | convert-style-to-html.xsl | 25 | ||||
-rw-r--r-- | endnote-to-dbxml.xsl | 24 | ||||
-rw-r--r-- | util.xsl | 23 |
3 files changed, 25 insertions, 47 deletions
diff --git a/convert-style-to-html.xsl b/convert-style-to-html.xsl index 9858964..dbc7281 100644 --- a/convert-style-to-html.xsl +++ b/convert-style-to-html.xsl @@ -3,6 +3,8 @@ <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"> @@ -77,29 +79,6 @@ </xsl:copy> </xsl:template> - <xsl:template name="string-replace-all"> - <xsl:param name="text" /> - <xsl:param name="replace" /> - <xsl:param name="by" /> - <xsl:choose> - <xsl:when test="$replace = ''"> - <xsl:value-of select="$text" /> - </xsl:when> - <xsl:when test="contains($text, $replace)"> - <xsl:value-of select="substring-before($text,$replace)" /> - <xsl:value-of select="$by" /> - <xsl:call-template name="string-replace-all"> - <xsl:with-param name="text" select="substring-after($text,$replace)" /> - <xsl:with-param name="replace" select="$replace" /> - <xsl:with-param name="by" select="$by" /> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$text" /> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> diff --git a/endnote-to-dbxml.xsl b/endnote-to-dbxml.xsl index f8880db..1783f0a 100644 --- a/endnote-to-dbxml.xsl +++ b/endnote-to-dbxml.xsl @@ -91,28 +91,4 @@ </db> </xsl:template> - - <xsl:template name="string-replace-all"> - <xsl:param name="text" /> - <xsl:param name="replace" /> - <xsl:param name="by" /> - <xsl:choose> - <xsl:when test="$replace = ''"> - <xsl:value-of select="$text" /> - </xsl:when> - <xsl:when test="contains($text, $replace)"> - <xsl:value-of select="substring-before($text,$replace)" /> - <xsl:value-of select="$by" /> - <xsl:call-template name="string-replace-all"> - <xsl:with-param name="text" select="substring-after($text,$replace)" /> - <xsl:with-param name="replace" select="$replace" /> - <xsl:with-param name="by" select="$by" /> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$text" /> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - </xsl:stylesheet> @@ -51,4 +51,27 @@ <xsl:template mode="nodetype" match="@*">attribute</xsl:template> <xsl:template mode="nodetype" match="text()">text</xsl:template> + <xsl:template name="string-replace-all"> + <xsl:param name="text" /> + <xsl:param name="replace" /> + <xsl:param name="by" /> + <xsl:choose> + <xsl:when test="$replace = ''"> + <xsl:value-of select="$text" /> + </xsl:when> + <xsl:when test="contains($text, $replace)"> + <xsl:value-of select="substring-before($text,$replace)" /> + <xsl:value-of select="$by" /> + <xsl:call-template name="string-replace-all"> + <xsl:with-param name="text" select="substring-after($text,$replace)" /> + <xsl:with-param name="replace" select="$replace" /> + <xsl:with-param name="by" select="$by" /> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$text" /> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + </xsl:stylesheet> |