aboutsummaryrefslogtreecommitdiff
path: root/test/default_params
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-09 21:29:39 +0200
committerAdrian Kummerländer2014-05-09 21:29:39 +0200
commit47b3bb0882a838ba794f105f3dc93ec45f5e1727 (patch)
tree170a570d09d791932e7c7d0e4b3ceb5e5c40d586 /test/default_params
parente83bbb457c98a0b77ca04e2832d7d0601912acd7 (diff)
downloadInputXSLT-47b3bb0882a838ba794f105f3dc93ec45f5e1727.tar
InputXSLT-47b3bb0882a838ba794f105f3dc93ec45f5e1727.tar.gz
InputXSLT-47b3bb0882a838ba794f105f3dc93ec45f5e1727.tar.bz2
InputXSLT-47b3bb0882a838ba794f105f3dc93ec45f5e1727.tar.lz
InputXSLT-47b3bb0882a838ba794f105f3dc93ec45f5e1727.tar.xz
InputXSLT-47b3bb0882a838ba794f105f3dc93ec45f5e1727.tar.zst
InputXSLT-47b3bb0882a838ba794f105f3dc93ec45f5e1727.zip
Added default target file and path parameters
* the transformation is now provided with default parameters such as the target file and its parent directory * added appropriate test case ** default_params * test frontend now doesn't provide a "test" parameter anymore * extracted parameter setter into separate member method "setParameters" of TransformationFacade
Diffstat (limited to 'test/default_params')
-rw-r--r--test/default_params/reference.xml7
-rw-r--r--test/default_params/transformation.xsl32
2 files changed, 39 insertions, 0 deletions
diff --git a/test/default_params/reference.xml b/test/default_params/reference.xml
new file mode 100644
index 0000000..fcdbacf
--- /dev/null
+++ b/test/default_params/reference.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<test_case>
+<default_params>
+<target_file>actual.xml</target_file>
+<parent_directory>default_params</parent_directory>
+</default_params>
+</test_case>
diff --git a/test/default_params/transformation.xsl b/test/default_params/transformation.xsl
new file mode 100644
index 0000000..1bbddef
--- /dev/null
+++ b/test/default_params/transformation.xsl
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:InputXSLT="function.inputxslt.application"
+ exclude-result-prefixes="InputXSLT"
+>
+
+<xsl:output
+ method="xml"
+ omit-xml-declaration="no"
+ encoding="UTF-8"
+ indent="yes"
+/>
+
+<xsl:param name="target-file"/>
+<xsl:param name="parent-directory"/>
+
+<xsl:template match="/">
+<test_case>
+ <default_params>
+ <target_file>
+ <xsl:value-of select="$target-file"/>
+ </target_file>
+ <parent_directory>
+ <xsl:value-of select="$parent-directory"/>
+ </parent_directory>
+ </default_params>
+</test_case>
+</xsl:template>
+
+</xsl:stylesheet>