summaryrefslogtreecommitdiff
path: root/tests/auto/xmlpatterns/stylesheets
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commite1b2c9deb5943faae2b29be6a5c006f75bb73f06 (patch)
treefc79e45367c0a8fc71185e9afc33f7503a58653c /tests/auto/xmlpatterns/stylesheets
downloadqtxmlpatterns-e1b2c9deb5943faae2b29be6a5c006f75bb73f06.tar.gz
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
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>