Skip to content
Snippets Groups Projects
Commit 1624e5c9 authored by Goik Martin's avatar Goik Martin
Browse files

Tidy up!

parent 7c6812d3
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:variable name="str">Ref/Fig/jdbcparam.fig</xsl:variable>
<xsl:variable name="dirPath">
<xsl:call-template name="hdm.get.leftmost.of.seperator">
<xsl:with-param name="path" select="$str"/>
<xsl:with-param name="seperator" select="'/'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="fileName">
<xsl:call-template name="hdm.get.pure.filename">
<xsl:with-param name="path" select="$str"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="fileBaseName">
<xsl:call-template name="hdm.get.leftmost.of.seperator">
<xsl:with-param name="path" select="$str"/>
<xsl:with-param name="seperator" select="'.'"/>
</xsl:call-template>
</xsl:variable>
<!--
<xsl:variable name="dirPath">
<xsl:value-of select="fn:string-join(fn:tokenize($str, '/')[position() &lt;last()], '/')"/>
</xsl:variable>
<xsl:variable name="fileName">
<xsl:value-of select="fn:tokenize($str, '/')[last()]"/>
</xsl:variable>
<xsl:variable name="fileBaseName">
<xsl:value-of select="fn:string-join(fn:tokenize($fileName, '\.')[position() &lt;last()], '.')"/>
</xsl:variable>
-->
<xsl:text>
</xsl:text>
<xsl:value-of select="$fileBaseName"/>
</xsl:template>
<xsl:template name="hdm.get.leftmost.of.seperator">
<xsl:param name="path"/>
<xsl:param name="seperator"/>
<xsl:param name="start">1</xsl:param>
<xsl:if test="contains($path, $seperator )">
<xsl:if test="$start='0'">
<xsl:value-of select="$seperator"/>
</xsl:if>
<xsl:value-of select="substring-before($path, $seperator)"/>
<xsl:call-template name="hdm.get.leftmost.of.seperator">
<xsl:with-param name="path" select="substring-after($path, $seperator)"/>
<xsl:with-param name="seperator" select="$seperator"/>
<xsl:with-param name="start">0</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="hdm.get.pure.filename">
<xsl:param name="path"/>
<xsl:choose>
<xsl:when test="contains($path, '/' )">
<xsl:call-template name="hdm.get.pure.filename">
<xsl:with-param name="path">
<xsl:value-of select="substring-after($path, '/')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment