diff options
Diffstat (limited to 'kxsldbg/data')
-rw-r--r-- | kxsldbg/data/Makefile.am | 16 | ||||
-rw-r--r-- | kxsldbg/data/empty.xml | 12 | ||||
-rw-r--r-- | kxsldbg/data/empty.xsl | 19 | ||||
-rw-r--r-- | kxsldbg/data/test1.xml | 17 | ||||
-rw-r--r-- | kxsldbg/data/test2.xml | 30 | ||||
-rw-r--r-- | kxsldbg/data/test3.xml | 29 | ||||
-rw-r--r-- | kxsldbg/data/test4.xml | 27 | ||||
-rw-r--r-- | kxsldbg/data/test_import.xsl | 17 | ||||
-rw-r--r-- | kxsldbg/data/test_include_bot.xsl | 17 | ||||
-rw-r--r-- | kxsldbg/data/test_include_top.xsl | 17 | ||||
-rw-r--r-- | kxsldbg/data/testdoc.dtd | 6 | ||||
-rw-r--r-- | kxsldbg/data/testdoc.xml | 33 | ||||
-rw-r--r-- | kxsldbg/data/testdoc.xsl | 141 |
13 files changed, 381 insertions, 0 deletions
diff --git a/kxsldbg/data/Makefile.am b/kxsldbg/data/Makefile.am new file mode 100644 index 00000000..d6bd3286 --- /dev/null +++ b/kxsldbg/data/Makefile.am @@ -0,0 +1,16 @@ +SUBDIRS = + + +# Provide a example XSLT scripts : testdoc.xsl and empty.xsl +commondata = test1.xml test2.xml test3.xml test4.xml \ + test_import.xsl test_include_bot.xsl test_include_top.xsl \ + testdoc.dtd testdoc.xml testdoc.xsl \ + empty.xsl empty.xml + + +kxsldbgdir = ${kde_datadir}/kxsldbg +kxsldbg_DATA = ${commondata} + + +xsldbgdir = ${kde_datadir}/xsldbg +xsldbg_DATA = ${commondata} diff --git a/kxsldbg/data/empty.xml b/kxsldbg/data/empty.xml new file mode 100644 index 00000000..aa9ac07e --- /dev/null +++ b/kxsldbg/data/empty.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + File : empty.xml + Author: Keith Isdale <[email protected]> + Description: empty xml data for getting started + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> +<empty> + Empty example data file +</empty> diff --git a/kxsldbg/data/empty.xsl b/kxsldbg/data/empty.xsl new file mode 100644 index 00000000..ab4548ef --- /dev/null +++ b/kxsldbg/data/empty.xsl @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + File : empty.xsl + Author: Keith Isdale <[email protected]> + Description: empty stylesheet for getting started + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" +version="1.0"> + + <xsl:output method="text"/> + + <xsl:template match="/"> + <xsl:apply-templates /> + </xsl:template> +</xsl:stylesheet> + diff --git a/kxsldbg/data/test1.xml b/kxsldbg/data/test1.xml new file mode 100644 index 00000000..06c35dde --- /dev/null +++ b/kxsldbg/data/test1.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + File : test1.xml + Author: Keith Isdale <[email protected]> + Description: xml data for stylesheet for testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> +<html> +<head> +</head> +<body> + <h1>test1</h1> + <p>text1</p> +</body> +</html> diff --git a/kxsldbg/data/test2.xml b/kxsldbg/data/test2.xml new file mode 100644 index 00000000..80bf77a7 --- /dev/null +++ b/kxsldbg/data/test2.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + File : test2.xml + Author: Keith Isdale <[email protected]> + Description: xml data for stylesheet for testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> + +<result> + <head name="foo"/> + <data name="fred"/> + <data name="barney"/> + <data name="pebbles"/> + <extra name="wilma"/> +</result> + + + +<!-- initialization code for xemacs --> +<!-- +Local Variables: +mode: sgml +sgml-minimize-attributes:nil +sgml-general-insert-case:lower +sgml-indent-step:0 +sgml-indent-data:nil +End: +--> diff --git a/kxsldbg/data/test3.xml b/kxsldbg/data/test3.xml new file mode 100644 index 00000000..706321e4 --- /dev/null +++ b/kxsldbg/data/test3.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + File : test3.xml + Author: Keith Isdale <[email protected]> + Description: xml data for stylesheet for testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> + +<result> + <data>2</data> + <data>1</data> + <data>3</data> + <extra/> +</result> + + + +<!-- initialization code for xemacs --> +<!-- +Local Variables: +mode: sgml +sgml-minimize-attributes:nil +sgml-general-insert-case:lower +sgml-indent-step:0 +sgml-indent-data:nil +End: +--> diff --git a/kxsldbg/data/test4.xml b/kxsldbg/data/test4.xml new file mode 100644 index 00000000..437ca18e --- /dev/null +++ b/kxsldbg/data/test4.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + File : test4.xml + Author: Keith Isdale <[email protected]> + Description: xml data for stylesheet for testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> + +<result> + <data/> + <extra/> +</result> + + + +<!-- initialization code for xemacs --> +<!-- +Local Variables: +mode: sgml +sgml-minimize-attributes:nil +sgml-general-insert-case:lower +sgml-indent-step:0 +sgml-indent-data:nil +End: +--> diff --git a/kxsldbg/data/test_import.xsl b/kxsldbg/data/test_import.xsl new file mode 100644 index 00000000..e48539eb --- /dev/null +++ b/kxsldbg/data/test_import.xsl @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + File : test_import.xsl + Author: Keith Isdale <[email protected]> + Description: stylesheet for testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:template match="head"> + <xsl:apply-templates/> + </xsl:template> + +</xsl:stylesheet> diff --git a/kxsldbg/data/test_include_bot.xsl b/kxsldbg/data/test_include_bot.xsl new file mode 100644 index 00000000..6dd6c9aa --- /dev/null +++ b/kxsldbg/data/test_include_bot.xsl @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + File : test_include.xsl + Author: Keith Isdale <[email protected]> + Description: stylesheet for include testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:template match="include_bot"> + <xsl:apply-templates/> + </xsl:template> + +</xsl:stylesheet> diff --git a/kxsldbg/data/test_include_top.xsl b/kxsldbg/data/test_include_top.xsl new file mode 100644 index 00000000..df7e4967 --- /dev/null +++ b/kxsldbg/data/test_include_top.xsl @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + File : test_include_top.xsl + Author: Keith Isdale <[email protected]> + Description: stylesheet for include testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:template name="import_top"> + <xsl:apply-templates select="result/head"/> + </xsl:template> + +</xsl:stylesheet> diff --git a/kxsldbg/data/testdoc.dtd b/kxsldbg/data/testdoc.dtd new file mode 100644 index 00000000..08e9108a --- /dev/null +++ b/kxsldbg/data/testdoc.dtd @@ -0,0 +1,6 @@ +<!ELEMENT simple (#PCDATA)> +<!ENTITY mytext "Some text"> +<!ENTITY anotherDoc SYSTEM "test1.xml" > +<!ENTITY anotherDoc2 SYSTEM "test2.xml" > +<!ENTITY anotherDoc3 SYSTEM "test3.xml" > +<!ENTITY anotherDoc4 SYSTEM "test4.xml" >
\ No newline at end of file diff --git a/kxsldbg/data/testdoc.xml b/kxsldbg/data/testdoc.xml new file mode 100644 index 00000000..894fbbfe --- /dev/null +++ b/kxsldbg/data/testdoc.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + File : testdoc.xml + Author: Keith Isdale <[email protected]> + Description: xml data for stylesheet for testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> + +<!DOCTYPE simple SYSTEM "testdoc.dtd"> + +<simple> + &mytext; + &anotherDoc; + &anotherDoc; + &anotherDoc; + &anotherDoc2; + &anotherDoc3; + &anotherDoc4; +</simple> + + +<!-- initialization code for xemacs --> +<!-- +Local Variables: +mode: sgml +sgml-minimize-attributes:nil +sgml-general-insert-case:lower +sgml-indent-step:0 +sgml-indent-data:nil +End: +--> diff --git a/kxsldbg/data/testdoc.xsl b/kxsldbg/data/testdoc.xsl new file mode 100644 index 00000000..da6447f3 --- /dev/null +++ b/kxsldbg/data/testdoc.xsl @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + File : testdoc.xsl + Author: Keith Isdale <[email protected]> + Description: stylesheet for testing + Copyright Reserved Under GPL +--> +<!-- This file does not require translation --> +<!-- NO TRANSLATION --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" +version="1.0"> + + <xsl:import href="test_import.xsl"/> + <xsl:include href="test_include_top.xsl"/> + <xsl:strip-space elements="text()"/> + <xsl:decimal-format name="test" decimal-separator="."/> + <xsl:output method="text"/> + <xsl:variable name="globalvariable" select="'foo'"/> + + <xsl:template match="/"> + <xsl:call-template name="test_set_variable"> + <xsl:with-param name="item" select="'1234'"/> + </xsl:call-template> + + <xsl:variable name="localvariable" select="'bar'"/> + <xsl:text>Global variable contains </xsl:text><xsl:value-of select="$globalvariable"/><xsl:text> +</xsl:text> + <xsl:text>Local variable contains </xsl:text><xsl:value-of select="$localvariable"/><xsl:text> +</xsl:text> + + <!-- test import of xsl file --> + <xsl:call-template name="import_top"/> + + <!-- Basic xsl:apply-templates, xsl:call-template usage --> + <!-- Test basic usage of xsl:apply-templates --> + <xsl:apply-templates select="//result/data"/> + <!-- Test basic usage of xsl:call-template --> + <xsl:call-template name="call-template1"/> + + <!-- Test xsl:apply-templates with parameter value. + Test the ability to step into a xsl:with-param child --> + <xsl:apply-templates select="//result/data"> + <xsl:with-param name="item"> + <item/> + </xsl:with-param> + </xsl:apply-templates> + + <!-- Test xsl:call-template with parameter value + Test the ability to step into a xsl:with-param child --> + <xsl:call-template name="call-template2"> + <xsl:with-param name="item"> + <item /> + </xsl:with-param> + </xsl:call-template> + + <!-- Test ability to step into xsl:param from xsl:apply-templates --> + <xsl:apply-templates select="//result/extra" /> + + <!-- Test ability to step into xsl:param from xsl:call-template --> + <xsl:call-template name="call-template3" /> + + <!-- Test ability to step into xsl:sort from xsl:apply-templates --> + <xsl:apply-templates select="//result/data"> + <xsl:sort select="."/> + <xsl:text> +</xsl:text> + </xsl:apply-templates> + + <xsl:apply-imports/> <!-- useless but test that we can step to it --> + + <xsl:apply-templates select="//result/data" mode="verbose" /> + + </xsl:template> + + + <xsl:template match="result"> + <xsl:param name="item" select="'default'"/> + <!-- ignore node content --> + </xsl:template> + + + <xsl:template match="data"> + <!-- ignore node content --> + </xsl:template> + + <xsl:template match="data" mode="verbose"> + <xsl:apply-templates /> + </xsl:template> + + + <xsl:template match="extra"> + <xsl:param name="item"> + <item/> + </xsl:param> + <!-- ignore node content --> + <xsl:text> +</xsl:text> + </xsl:template> + + + <xsl:template name="call-template1"> + <xsl:number value="position()" format="1."/> + <xsl:text> +</xsl:text> + </xsl:template> + + + <xsl:template name="call-template2"> + <!-- ignore any param provided --> + <!-- test message --> + <xsl:message terminate="no">Message here</xsl:message> + <xsl:processing-instruction name="pitest"> + pi text + </xsl:processing-instruction> + <xsl:text> +</xsl:text> + </xsl:template> + + + <xsl:template name="call-template3"> + <xsl:param name="item"> + <item/> + </xsl:param> + <!-- test comments --> + <xsl:comment>A text comment.</xsl:comment> + <!-- test copy and copy-of --> + <xsl:copy>copy text</xsl:copy> + <xsl:copy-of select="'copy-of Text'"/> + <xsl:text> +</xsl:text> + </xsl:template> + + + <xsl:template name="test_set_variable"> + <xsl:param name="item" select="'default-value'"/> + <xsl:value-of select="$item"/> + <xsl:text> +</xsl:text> + </xsl:template> + +</xsl:stylesheet> |