You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mu...@apache.org on 2023/08/29 14:00:45 UTC
[xalan-java] branch xalan-j_xslt3.0 updated: committing few new working xslt 3.0 test cases, related to xpath 3.1 'for' and quantified expressions
This is an automated email from the ASF dual-hosted git repository.
mukulg pushed a commit to branch xalan-j_xslt3.0
in repository https://gitbox.apache.org/repos/asf/xalan-java.git
The following commit(s) were added to refs/heads/xalan-j_xslt3.0 by this push:
new 22f4f102 committing few new working xslt 3.0 test cases, related to xpath 3.1 'for' and quantified expressions
new 34ba0c61 Merge pull request #69 from mukulga/xalan-j_xslt3.0_mukul
22f4f102 is described below
commit 22f4f102efc85f0d771b57acbb15c071293438c0
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Tue Aug 29 19:24:50 2023 +0530
committing few new working xslt 3.0 test cases, related to xpath 3.1 'for' and quantified expressions
---
tests/for_expr/gold/test16.out | 4 ++
tests/for_expr/test16.xsl | 49 ++++++++++++++++++++
tests/for_expr/test1_d.xml | 7 +++
tests/org/apache/xalan/xpath3/ForExprTests.java | 10 +++++
.../apache/xalan/xpath3/QuantifiedExprTests.java | 10 +++++
tests/quantified_expr/gold/test15.out | 6 +++
tests/quantified_expr/test15.xsl | 52 ++++++++++++++++++++++
tests/quantified_expr/test1_i.xml | 7 +++
8 files changed, 145 insertions(+)
diff --git a/tests/for_expr/gold/test16.out b/tests/for_expr/gold/test16.out
new file mode 100644
index 00000000..abe7c170
--- /dev/null
+++ b/tests/for_expr/gold/test16.out
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+ <one>2012-10-12</one>
+ <two>2001-10-02</two>
+</result>
diff --git a/tests/for_expr/test16.xsl b/tests/for_expr/test16.xsl
new file mode 100644
index 00000000..51e07b7b
--- /dev/null
+++ b/tests/for_expr/test16.xsl
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ exclude-result-prefixes="xs"
+ version="3.0">
+
+ <!-- Author: mukulg@apache.org -->
+
+ <!-- use with test1_d.xml -->
+
+ <!-- An XSLT stylesheet test, to test the evaluation of an
+ XPath 3.1 "for" expression.
+
+ This stylesheet, finds the maximum and minimum xs:date
+ values within a sequence of XML element nodes.
+ -->
+
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:template match="/info">
+ <result>
+ <one>
+ <xsl:value-of select="max(for $dt in * return xs:date($dt))"/>
+ </one>
+ <two>
+ <xsl:value-of select="min(for $dt in * return xs:date($dt))"/>
+ </two>
+ </result>
+ </xsl:template>
+
+ <!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/for_expr/test1_d.xml b/tests/for_expr/test1_d.xml
new file mode 100644
index 00000000..c25a608d
--- /dev/null
+++ b/tests/for_expr/test1_d.xml
@@ -0,0 +1,7 @@
+<info>
+ <a>2005-10-12</a>
+ <b>2002-10-12</b>
+ <c>2010-10-12</c>
+ <d>2012-10-12</d>
+ <e>2001-10-02</e>
+</info>
\ No newline at end of file
diff --git a/tests/org/apache/xalan/xpath3/ForExprTests.java b/tests/org/apache/xalan/xpath3/ForExprTests.java
index 6545844d..aaf204af 100644
--- a/tests/org/apache/xalan/xpath3/ForExprTests.java
+++ b/tests/org/apache/xalan/xpath3/ForExprTests.java
@@ -196,5 +196,15 @@ public class ForExprTests extends XslTransformTestsUtil {
runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
}
+
+ @Test
+ public void xslForExprTest16() {
+ String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_d.xml";
+ String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test16.xsl";
+
+ String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test16.out";
+
+ runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+ }
}
diff --git a/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java b/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java
index 6861f869..205b8fe5 100644
--- a/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java
+++ b/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java
@@ -201,5 +201,15 @@ public class QuantifiedExprTests extends XslTransformTestsUtil {
runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
}
+
+ @Test
+ public void xslQuantifiedExprTest16() {
+ String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_i.xml";
+ String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test15.xsl";
+
+ String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test15.out";
+
+ runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+ }
}
diff --git a/tests/quantified_expr/gold/test15.out b/tests/quantified_expr/gold/test15.out
new file mode 100644
index 00000000..414b5c83
--- /dev/null
+++ b/tests/quantified_expr/gold/test15.out
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+ <one>false</one>
+ <two>true</two>
+ <three>false</three>
+ <four>true</four>
+</result>
diff --git a/tests/quantified_expr/test15.xsl b/tests/quantified_expr/test15.xsl
new file mode 100644
index 00000000..6f5692d9
--- /dev/null
+++ b/tests/quantified_expr/test15.xsl
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ exclude-result-prefixes="xs"
+ version="3.0">
+
+ <!-- Author: mukulg@apache.org -->
+
+ <!-- use with test1_i.xml -->
+
+ <!-- An XSLT stylesheet test case, to test the XPath 3.1 quantified
+ expressions 'some' and 'every'.
+ -->
+
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:template match="/info">
+ <result>
+ <one>
+ <xsl:value-of select="every $dt in * satisfies (xs:date($dt) gt current-date())"/>
+ </one>
+ <two>
+ <xsl:value-of select="every $dt in * satisfies (xs:date($dt) lt current-date())"/>
+ </two>
+ <three>
+ <xsl:value-of select="some $dt in * satisfies (xs:date($dt) gt current-date())"/>
+ </three>
+ <four>
+ <xsl:value-of select="some $dt in * satisfies (xs:date($dt) lt current-date())"/>
+ </four>
+ </result>
+ </xsl:template>
+
+ <!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/quantified_expr/test1_i.xml b/tests/quantified_expr/test1_i.xml
new file mode 100644
index 00000000..c25a608d
--- /dev/null
+++ b/tests/quantified_expr/test1_i.xml
@@ -0,0 +1,7 @@
+<info>
+ <a>2005-10-12</a>
+ <b>2002-10-12</b>
+ <c>2010-10-12</c>
+ <d>2012-10-12</d>
+ <e>2001-10-02</e>
+</info>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org