summaryrefslogtreecommitdiffstats
path: root/tests/auto/xmlpatterns/stylesheets
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-23 09:34:13 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-23 09:34:13 (GMT)
commit67ad0519fd165acee4a4d2a94fa502e9e4847bd0 (patch)
tree1dbf50b3dff8d5ca7e9344733968c72704eb15ff /tests/auto/xmlpatterns/stylesheets
downloadQt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.zip
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.gz
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.bz2
Long live Qt!
Diffstat (limited to 'tests/auto/xmlpatterns/stylesheets')
-rw-r--r--tests/auto/xmlpatterns/stylesheets/bool070.xml1
-rw-r--r--tests/auto/xmlpatterns/stylesheets/bool070.xsl6
-rw-r--r--tests/auto/xmlpatterns/stylesheets/copyWholeDocument.xsl9
-rw-r--r--tests/auto/xmlpatterns/stylesheets/documentElement.xml1
-rw-r--r--tests/auto/xmlpatterns/stylesheets/namedAndRootTemplate.xsl5
-rw-r--r--tests/auto/xmlpatterns/stylesheets/namedTemplate.xsl8
-rw-r--r--tests/auto/xmlpatterns/stylesheets/notWellformed.xsl9
-rw-r--r--tests/auto/xmlpatterns/stylesheets/onlyRootTemplate.xsl9
-rw-r--r--tests/auto/xmlpatterns/stylesheets/parameters.xsl41
-rw-r--r--tests/auto/xmlpatterns/stylesheets/queryAsStylesheet.xsl1
-rw-r--r--tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xml1
-rw-r--r--tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xsl4
-rw-r--r--tests/auto/xmlpatterns/stylesheets/useParameters.xsl16
13 files changed, 111 insertions, 0 deletions
diff --git a/tests/auto/xmlpatterns/stylesheets/bool070.xml b/tests/auto/xmlpatterns/stylesheets/bool070.xml
new file mode 100644
index 0000000..3504667
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/bool070.xml
@@ -0,0 +1 @@
+<a><b/><</a>
diff --git a/tests/auto/xmlpatterns/stylesheets/bool070.xsl b/tests/auto/xmlpatterns/stylesheets/bool070.xsl
new file mode 100644
index 0000000..a78e61a
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/bool070.xsl
@@ -0,0 +1,6 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:template match="/">
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/tests/auto/xmlpatterns/stylesheets/copyWholeDocument.xsl b/tests/auto/xmlpatterns/stylesheets/copyWholeDocument.xsl
new file mode 100644
index 0000000..1cd90c4
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/copyWholeDocument.xsl
@@ -0,0 +1,9 @@
+<xsl:stylesheet
+ version="2.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template match="/">
+ <xsl:copy-of select="."/>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/tests/auto/xmlpatterns/stylesheets/documentElement.xml b/tests/auto/xmlpatterns/stylesheets/documentElement.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/documentElement.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/auto/xmlpatterns/stylesheets/namedAndRootTemplate.xsl b/tests/auto/xmlpatterns/stylesheets/namedAndRootTemplate.xsl
new file mode 100644
index 0000000..3e8f93d
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/namedAndRootTemplate.xsl
@@ -0,0 +1,5 @@
+<xsl:stylesheet xmlns:ex="http://example.com/NS" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+ <xsl:template match="/">root-template</xsl:template>
+ <xsl:template name="main">named-template</xsl:template>
+ <xsl:template name="ex:main">namespaced-template</xsl:template>
+</xsl:stylesheet>
diff --git a/tests/auto/xmlpatterns/stylesheets/namedTemplate.xsl b/tests/auto/xmlpatterns/stylesheets/namedTemplate.xsl
new file mode 100644
index 0000000..e296e6d
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/namedTemplate.xsl
@@ -0,0 +1,8 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+
+ <xsl:template name="main">
+ <xsl:value-of select="1 to 5"/>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/auto/xmlpatterns/stylesheets/notWellformed.xsl b/tests/auto/xmlpatterns/stylesheets/notWellformed.xsl
new file mode 100644
index 0000000..241668a
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/notWellformed.xsl
@@ -0,0 +1,9 @@
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template match="/
+ <out>
+ <xsl:copy-of select="document('bug42.xml', /)"/>
+ </out>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/tests/auto/xmlpatterns/stylesheets/onlyRootTemplate.xsl b/tests/auto/xmlpatterns/stylesheets/onlyRootTemplate.xsl
new file mode 100644
index 0000000..d40874c
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/onlyRootTemplate.xsl
@@ -0,0 +1,9 @@
+<xsl:stylesheet
+ version="2.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template match="/">
+ <result/>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/tests/auto/xmlpatterns/stylesheets/parameters.xsl b/tests/auto/xmlpatterns/stylesheets/parameters.xsl
new file mode 100644
index 0000000..db0a4aa
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/parameters.xsl
@@ -0,0 +1,41 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ version="2.0">
+
+ <!-- QXmlQuery::bindVariable() never overrides xsl:variable. -->
+ <xsl:variable name="variableNoSelectNoBody"/>
+ <xsl:variable name="variableNoSelectNoBodyBoundWithBindVariable"/> <!-- Test calls bindVariable() for this. -->
+ <xsl:variable name="variableSelect" select="'variableSelectsDefaultValue'"/>
+ <xsl:variable name="variableSelectBoundWithBindVariable" select="'variableSelectsDefaultValue2'"/> <!-- Test calls bindVariable() for this. -->
+ <xsl:variable name="variableSelectWithTypeInt" as="xs:integer" select="3"/>
+ <xsl:variable name="variableSelectWithTypeIntBoundWithBindVariable" as="xs:integer" select="4"/> <!-- Test calls bindVariable() for this. -->
+
+ <xsl:param name="paramNoSelectNoBody"/>
+ <xsl:param name="paramNoSelectNoBodyBoundWithBindVariable"/> <!-- Test calls bindVariable() for this. -->
+ <xsl:param name="paramNoSelectNoBodyBoundWithBindVariableRequired" required="yes"/> <!-- Test calls bindVariable() for this. -->
+ <xsl:param name="paramSelect" select="'variableSelectsDefaultValue'"/>
+ <xsl:param name="paramSelectBoundWithBindVariable" select="'variableSelectsDefaultValue'"/> <!-- Test calls bindVariable() for this. -->
+ <xsl:param name="paramSelectBoundWithBindVariableRequired" required="yes"/> <!-- Test calls bindVariable() for this. -->
+ <xsl:param name="paramSelectWithTypeInt" as="xs:integer" select="1"/>
+ <xsl:param name="paramSelectWithTypeIntBoundWithBindVariable" as="xs:integer" select="1"/> <!-- Test calls bindVariable() for this. -->
+ <xsl:param name="paramSelectWithTypeIntBoundWithBindVariableRequired" required="yes" as="xs:integer"/> <!-- Test calls bindVariable() for this. -->
+
+ <xsl:template name="main">
+ <xsl:sequence select="'Variables:',
+ $variableNoSelectNoBody,
+ $variableNoSelectNoBodyBoundWithBindVariable,
+ $variableSelect,
+ $variableSelectBoundWithBindVariable,
+ $variableSelectWithTypeInt,
+ $variableSelectWithTypeIntBoundWithBindVariable,
+ 'Parameters:',
+ $paramNoSelectNoBodyBoundWithBindVariable,
+ $paramNoSelectNoBodyBoundWithBindVariableRequired,
+ $paramSelectBoundWithBindVariable,
+ $paramSelectBoundWithBindVariableRequired,
+ $paramSelectWithTypeIntBoundWithBindVariable,
+ $paramSelectWithTypeIntBoundWithBindVariableRequired"/>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/auto/xmlpatterns/stylesheets/queryAsStylesheet.xsl b/tests/auto/xmlpatterns/stylesheets/queryAsStylesheet.xsl
new file mode 100644
index 0000000..8d2f097
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/queryAsStylesheet.xsl
@@ -0,0 +1 @@
+1 + 1
diff --git a/tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xml b/tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xml
new file mode 100644
index 0000000..067f98f
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xml
@@ -0,0 +1 @@
+<input>some text</input>
diff --git a/tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xsl b/tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xsl
new file mode 100644
index 0000000..63da011
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/simplifiedStylesheetModule.xsl
@@ -0,0 +1,4 @@
+<output xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:value-of select="/"/>
+</output>
+
diff --git a/tests/auto/xmlpatterns/stylesheets/useParameters.xsl b/tests/auto/xmlpatterns/stylesheets/useParameters.xsl
new file mode 100644
index 0000000..72aa056
--- /dev/null
+++ b/tests/auto/xmlpatterns/stylesheets/useParameters.xsl
@@ -0,0 +1,16 @@
+<xsl:stylesheet
+ version="2.0"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="defaultedParam" select="'defParam'"/>
+ <xsl:param name="overridedDefaultedParam" select="'DOESNOTAPPEAR'"/>
+ <xsl:param name="implicitlyRequiredValue" as="xs:string"/>
+
+ <xsl:template name="main">
+ <xsl:sequence select="$defaultedParam,
+ $overridedDefaultedParam,
+ $implicitlyRequiredValue"/>
+ </xsl:template>
+
+</xsl:stylesheet>