From 086779c6d3d40f244b6aafd6d402fd29b921a735 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 12 Jul 2014 16:15:42 +0200 Subject: Implemented external "generate" function * this function essentially provides the same functionality as FunctionTransform with the addition of directly committing the result to the filesystem ** this is needed if one wants to generate doctype-containing transformations from inside a transformation as "write-file" is not able to infer the doctype of a given xalan::XalanNode pointer ** this is a integral limitation of (at least) XSLT 1.0 as implemented in Apache Xalan *** a document can of course only have a single document type *** e.g. we can not include a doctype node in the result tree of FunctionTransform * implemented test case for FunctionGenerate * transformation "test.xsl" is shared between the FunctionTransform and FunctionGenerate test cases * modified README.md accordingly --- test/common/test.xsl | 30 ++++++++++++++++++++ test/generate/reference.xml | 10 +++++++ test/generate/transformation.xsl | 58 +++++++++++++++++++++++++++++++++++++++ test/read_directory/reference.xml | 3 ++ test/transform/test.xsl | 30 -------------------- test/transform/transformation.xsl | 2 +- 6 files changed, 102 insertions(+), 31 deletions(-) create mode 100644 test/common/test.xsl create mode 100644 test/generate/reference.xml create mode 100644 test/generate/transformation.xsl delete mode 100644 test/transform/test.xsl (limited to 'test') diff --git a/test/common/test.xsl b/test/common/test.xsl new file mode 100644 index 0000000..a9f04a5 --- /dev/null +++ b/test/common/test.xsl @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + diff --git a/test/generate/reference.xml b/test/generate/reference.xml new file mode 100644 index 0000000..1c702e8 --- /dev/null +++ b/test/generate/reference.xml @@ -0,0 +1,10 @@ + + + +Hello 1 +Hello 2 +Hello 3 +Hello 4 + +42 + diff --git a/test/generate/transformation.xsl b/test/generate/transformation.xsl new file mode 100644 index 0000000..6e3d88b --- /dev/null +++ b/test/generate/transformation.xsl @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + Hello 1 + Hello 2 + Hello 3 + Hello 4 + + + 21 + + + + [test.xsl] + test_actual.xml + + + + + + + + + + + + + + + + diff --git a/test/read_directory/reference.xml b/test/read_directory/reference.xml index 7d63a85..d2d9d1b 100644 --- a/test/read_directory/reference.xml +++ b/test/read_directory/reference.xml @@ -14,6 +14,9 @@ external_text_formatter +generate + + read_directory diff --git a/test/transform/test.xsl b/test/transform/test.xsl deleted file mode 100644 index a9f04a5..0000000 --- a/test/transform/test.xsl +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl index 7cfb8f9..247a4c6 100644 --- a/test/transform/transformation.xsl +++ b/test/transform/transformation.xsl @@ -36,7 +36,7 @@ - test.xsl + [test.xsl] -- cgit v1.2.3