aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-10-13 18:45:42 +0200
committerAdrian Kummerlaender2014-10-13 18:45:42 +0200
commit6384ffbd42f34b3639d36623e27889a2781408c1 (patch)
tree5b61f7d37113ad12f1d00f23ef984d3d9f1dde1f
parent7b25673658e7da8d1686a8395a58f1ad3da10d9e (diff)
downloadStaticXSLT-6384ffbd42f34b3639d36623e27889a2781408c1.tar
StaticXSLT-6384ffbd42f34b3639d36623e27889a2781408c1.tar.gz
StaticXSLT-6384ffbd42f34b3639d36623e27889a2781408c1.tar.bz2
StaticXSLT-6384ffbd42f34b3639d36623e27889a2781408c1.tar.lz
StaticXSLT-6384ffbd42f34b3639d36623e27889a2781408c1.tar.xz
StaticXSLT-6384ffbd42f34b3639d36623e27889a2781408c1.tar.zst
StaticXSLT-6384ffbd42f34b3639d36623e27889a2781408c1.zip
Added invalid mode error handling and unified xpath mode naming
* invalid target and datasource modes are now handled as terminating XSLT messages and are not silently dropped anymore * datasource xpath expression and target xpath expression mode are now uniformly named "xpath"
-rw-r--r--src/steps/process.xsl25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/steps/process.xsl b/src/steps/process.xsl
index 7b596b6..29599f4 100644
--- a/src/steps/process.xsl
+++ b/src/steps/process.xsl
@@ -85,6 +85,13 @@
<xsl:when test="$target/@mode = 'xpath'">
<xsl:value-of select="concat($prefix, '/', dyn:evaluate($target/@value))"/>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>Invalid target mode "</xsl:text>
+ <xsl:value-of select="$target/@mode"/>
+ <xsl:text>"</xsl:text>
+ </xsl:message>
+ </xsl:otherwise>
</xsl:choose>
</xsl:template>
@@ -100,9 +107,16 @@
concat($prefix, '/', @source)
)/self::file/*/*"/>
</xsl:when>
- <xsl:when test="@mode = 'expression'">
+ <xsl:when test="@mode = 'xpath'">
<xsl:copy-of select="dyn:evaluate(@source)"/>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>Invalid support datasource mode "</xsl:text>
+ <xsl:value-of select="@mode"/>
+ <xsl:text>"</xsl:text>
+ </xsl:message>
+ </xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:for-each>
@@ -181,11 +195,18 @@
)/self::file/*/*"/>
</xsl:element>
</xsl:when>
- <xsl:when test="$main_source/@mode = 'expression'">
+ <xsl:when test="$main_source/@mode = 'xpath'">
<xsl:element name="{$main_source/@target}">
<xsl:copy-of select="dyn:evaluate($main_source/@source)"/>
</xsl:element>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>Invalid main datasource mode "</xsl:text>
+ <xsl:value-of select="$main_source/@mode"/>
+ <xsl:text>"</xsl:text>
+ </xsl:message>
+ </xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="support" select="$support_source"/>