Skip to content

Commit dee3f24

Browse files
committed
[testsuite] fn:transform UT requested-properties
Implementation of “requested-properties” for fn:transform Add a unit test for the property “supports-namespace-axis”
1 parent 20dc1f1 commit dee3f24

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

exist-core/src/test/java/xquery/xquery3/XQuery3Tests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@RunWith(XSuite.class)
2828
@XSuite.XSuiteFiles({
2929
//"src/test/xquery/xquery3",
30-
"src/test/xquery/xquery3/fnTransform68.xqm"
30+
"src/test/xquery/xquery3/fnTransform74.xqm"
3131
})
3232
public class XQuery3Tests {
3333
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
(:
2+
: eXist-db Open Source Native XML Database
3+
: Copyright (C) 2001 The eXist-db Authors
4+
:
5+
6+
: http://www.exist-db.org
7+
:
8+
: This library is free software; you can redistribute it and/or
9+
: modify it under the terms of the GNU Lesser General Public
10+
: License as published by the Free Software Foundation; either
11+
: version 2.1 of the License, or (at your option) any later version.
12+
:
13+
: This library is distributed in the hope that it will be useful,
14+
: but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
: Lesser General Public License for more details.
17+
:
18+
: You should have received a copy of the GNU Lesser General Public
19+
: License along with this library; if not, write to the Free Software
20+
: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
:)
22+
xquery version "3.1";
23+
24+
module namespace testTransform="http://exist-db.org/xquery/test/function_transform";
25+
26+
declare namespace test="http://exist-db.org/xquery/xqsuite";
27+
28+
declare variable $testTransform:transform-74-xsl := "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
29+
version='2.0'>
30+
<xsl:template match='/'>
31+
<out><xsl:value-of select='*/namespace::xsl'/></out>
32+
</xsl:template>
33+
</xsl:stylesheet>";
34+
35+
declare
36+
%test:assertTrue
37+
function testTransform:transform-74-supports-namespace-axis-true() {
38+
let $xsl := $testTransform:transform-74-xsl
39+
let $result := fn:transform(map{
40+
"stylesheet-text":$xsl,
41+
"source-node": parse-xml($xsl),
42+
"delivery-format" : "serialized",
43+
"requested-properties" : map{fn:QName('http://www.w3.org/1999/XSL/Transform','supports-namespace-axis'):true()}
44+
})
45+
return contains($result("output"), ">http://www.w3.org/1999/XSL/Transform</out>")
46+
};
47+
48+
declare
49+
%test:assertError("FOXT0001")
50+
function testTransform:transform-74-supports-namespace-axis-false() {
51+
let $xsl := $testTransform:transform-74-xsl
52+
let $result := fn:transform(map{
53+
"stylesheet-text":$xsl,
54+
"source-node": parse-xml($xsl),
55+
"delivery-format" : "serialized",
56+
"requested-properties" : map{fn:QName('http://www.w3.org/1999/XSL/Transform','supports-namespace-axis'):false()}
57+
})
58+
return contains($result("output"), ">http://www.w3.org/1999/XSL/Transform</out>")
59+
};

0 commit comments

Comments
 (0)