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 2026/04/11 06:44:05 UTC
(xalan-java) branch xalan-j_xslt3.0_mvn updated: committing xalan-j xslt 3.0 implementation for xsl:next-match instruction
This is an automated email from the ASF dual-hosted git repository.
mukulg pushed a commit to branch xalan-j_xslt3.0_mvn
in repository https://gitbox.apache.org/repos/asf/xalan-java.git
The following commit(s) were added to refs/heads/xalan-j_xslt3.0_mvn by this push:
new 71c2196a5 committing xalan-j xslt 3.0 implementation for xsl:next-match instruction
71c2196a5 is described below
commit 71c2196a549b8e4ad6a1f392de74361ead92bcb3
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Sat Apr 11 12:13:37 2026 +0530
committing xalan-j xslt 3.0 implementation for xsl:next-match instruction
---
README | 8 +-
pom.xml | 41 ++--------
.../org/apache/xalan/processor/XSLTSchema.java | 20 +++--
.../java/org/apache/xalan/templates/Constants.java | 6 +-
.../apache/xalan/templates/ElemApplyTemplates.java | 44 +++++++---
.../org/apache/xalan/templates/ElemNextMatch.java | 94 ++++++++++++++++++++++
.../xalan/tests/main/XalanXsl3TestSuite2.java | 3 +-
.../xalan/tests/xslt3/XslNextMatchTests.java | 71 ++++++++++++++++
src/test/resources/xsl_next_match/gold/test1.out | 7 ++
src/test/resources/xsl_next_match/gold/test2.out | 5 ++
src/test/resources/xsl_next_match/test1.xml | 6 ++
src/test/resources/xsl_next_match/test1.xsl | 61 ++++++++++++++
src/test/resources/xsl_next_match/test2.xsl | 59 ++++++++++++++
13 files changed, 370 insertions(+), 55 deletions(-)
diff --git a/README b/README
index 4dff0023f..9d48c376b 100644
--- a/README
+++ b/README
@@ -17,7 +17,7 @@
Copyright 1999-2026 The Apache Software Foundation
-Document last modified : 2026-04-08
+Document last modified : 2026-04-11
Authors:
Gary Gregory <gg...@apache.org>
@@ -98,16 +98,16 @@ When this Maven build command is run, results like following shall be produced:
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.xalan.tests.main.XalanXsl3TestSuite2
-[INFO] Tests run: 515, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.981 s - in org.apache.xalan.tests.main.XalanXsl3TestSuite2
+[INFO] Tests run: 517, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.067 s - in org.apache.xalan.tests.main.XalanXsl3TestSuite2
[INFO]
[INFO] Results:
[INFO]
-[INFO] Tests run: 515, Failures: 0, Errors: 0, Skipped: 0
+[INFO] Tests run: 517, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
-[INFO] Total time: 45.827 s
+[INFO] Total time: 40.961 s
4) This code base repos branch also has Xalan Java's XSLT 3.0 test drivers for W3C XSLT 3.0 test suite (located at,
https://github.com/w3c/xslt30-test).
diff --git a/pom.xml b/pom.xml
index 77e114e10..577d01a88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -49,7 +49,7 @@
<dependency>
<groupId>org.apache.xerces</groupId>
<artifactId>xercesImpl</artifactId>
- <version>2.12.3_dev2</version>
+ <version>2.12.3_alpha</version>
</dependency>
<dependency>
<groupId>org.apache.xerces</groupId>
@@ -77,32 +77,12 @@
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
- <dependency>
- <groupId>org.apache.bcel</groupId>
- <artifactId>bcel</artifactId>
- <version>6.7.0</version>
- </dependency>
<dependency>
- <groupId>edu.princeton.cs</groupId>
- <artifactId>java_cup</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>edu.princeton.cs</groupId>
- <artifactId>cup_runtime</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>Jlex</groupId>
- <artifactId>Jlex</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.2</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -129,14 +109,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.22.0</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.surefire</groupId>
- <artifactId>surefire-junit4</artifactId>
- <version>2.22.0</version>
- </dependency>
- </dependencies>
+ <version>2.22.0</version>
<configuration>
<includes>
<include>**/*.java</include>
diff --git a/src/main/java/org/apache/xalan/processor/XSLTSchema.java b/src/main/java/org/apache/xalan/processor/XSLTSchema.java
index 98ecb8393..f724267c7 100644
--- a/src/main/java/org/apache/xalan/processor/XSLTSchema.java
+++ b/src/main/java/org/apache/xalan/processor/XSLTSchema.java
@@ -63,6 +63,7 @@ import org.apache.xalan.templates.ElemMergeSource;
import org.apache.xalan.templates.ElemMessage;
import org.apache.xalan.templates.ElemMode;
import org.apache.xalan.templates.ElemNamespace;
+import org.apache.xalan.templates.ElemNextMatch;
import org.apache.xalan.templates.ElemNonMatchingSubstring;
import org.apache.xalan.templates.ElemNumber;
import org.apache.xalan.templates.ElemOtherwise;
@@ -636,13 +637,13 @@ public class XSLTSchema extends XSLTElementDef
XSLTAttributeDef.T_CDATA, false, false,
XSLTAttributeDef.WARNING);
- XSLTElementDef[] templateElements = new XSLTElementDef[48];
- XSLTElementDef[] templateElementsAndParams = new XSLTElementDef[49];
- XSLTElementDef[] templateElementsAndSort = new XSLTElementDef[49];
+ XSLTElementDef[] templateElements = new XSLTElementDef[49];
+ XSLTElementDef[] templateElementsAndParams = new XSLTElementDef[50];
+ XSLTElementDef[] templateElementsAndSort = new XSLTElementDef[50];
//exslt
- XSLTElementDef[] exsltFunctionElements = new XSLTElementDef[49];
+ XSLTElementDef[] exsltFunctionElements = new XSLTElementDef[50];
- XSLTElementDef[] charTemplateElements = new XSLTElementDef[30];
+ XSLTElementDef[] charTemplateElements = new XSLTElementDef[31];
XSLTElementDef resultElement = new XSLTElementDef(this, null, "*",
null /*alias */,
templateElements /* elements */,
@@ -757,6 +758,13 @@ public class XSLTSchema extends XSLTElementDef
new ProcessorTemplateElem(),
ElemApplyImport.class /* class object */);
+ XSLTElementDef xslNextMatch =
+ new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "next-match",
+ null /*alias */, null /* elements */,
+ new XSLTAttributeDef[]{},
+ new ProcessorTemplateElem(),
+ ElemNextMatch.class /* class object */);
+
XSLTElementDef xslForEach = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "for-each",
null /*alias */, templateElementsAndSort,
@@ -1124,6 +1132,7 @@ public class XSLTSchema extends XSLTElementDef
templateElements[i++] = xslApplyTemplates;
templateElements[i++] = xslCallTemplate;
templateElements[i++] = xslApplyImports;
+ templateElements[i++] = xslNextMatch;
templateElements[i++] = xslForEach;
templateElements[i++] = xslPerformSort;
templateElements[i++] = xslForEachGroup;
@@ -1186,6 +1195,7 @@ public class XSLTSchema extends XSLTElementDef
charTemplateElements[i++] = xslApplyTemplates;
charTemplateElements[i++] = xslCallTemplate;
charTemplateElements[i++] = xslApplyImports;
+ charTemplateElements[i++] = xslNextMatch;
charTemplateElements[i++] = xslForEach;
charTemplateElements[i++] = xslPerformSort;
charTemplateElements[i++] = xslForEachGroup;
diff --git a/src/main/java/org/apache/xalan/templates/Constants.java b/src/main/java/org/apache/xalan/templates/Constants.java
index fd0e23673..094170c90 100644
--- a/src/main/java/org/apache/xalan/templates/Constants.java
+++ b/src/main/java/org/apache/xalan/templates/Constants.java
@@ -100,9 +100,10 @@ public class Constants extends org.apache.xml.utils.Constants
ELEMNAME_PERFORMSORT = 118,
ELEMNAME_USE_PACKAGE = 119,
ELEMNAME_ACCEPT = 120,
- ELEMNAME_GLOBAL_CONTEXT_ITEM = 121;
+ ELEMNAME_GLOBAL_CONTEXT_ITEM = 121,
+ ELEMNAME_NEXT_MATCH = 122;
- // next available number : 122
+ // next available number : 123
/**
* Literals for XSL element names. Note that there are more
@@ -112,6 +113,7 @@ public class Constants extends org.apache.xml.utils.Constants
ELEMNAME_ANCHOR_STRING = "anchor",
ELEMNAME_ANY_STRING = "any", // pattern-by-example support
ELEMNAME_APPLY_IMPORTS_STRING = "apply-imports",
+ ELEMNAME_NEXT_MATCH_STRING = "next-match",
ELEMNAME_APPLY_TEMPLATES_STRING = "apply-templates",
ELEMNAME_ARG_STRING = "arg",
ELEMNAME_ATTRIBUTESET_STRING = "attribute-set",
diff --git a/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java b/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java
index 6defa9ff9..27cda41c0 100644
--- a/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java
+++ b/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java
@@ -1224,16 +1224,42 @@ public class ElemApplyTemplates extends ElemCallTemplate
// evaluate this XSL stylesheet template's child elements.
for (ElemTemplateElement t = template.m_firstChild;
t != null; t = t.m_nextSibling) {
- xctxt.setSAXLocator(t);
-
- try
- {
- transformer.pushElemTemplateElement(t);
- t.execute(transformer);
+ try {
+ if (t instanceof ElemNextMatch) {
+ double p1 = template.getPriority();
+ XPath matchXPath = template.getMatch();
+ String matchPatternStr = matchXPath.getPatternString();
+ StylesheetRoot stylesheetRoot = transformer.getStylesheet();
+ TemplateList templateList = stylesheetRoot.getTemplateListComposed();
+ TemplateSubPatternAssociation association = templateList.getHead(xctxt, child, dtm2);
+ ElemTemplate desiredTemplate = null;
+ double pDesired = p1;
+ while ((association = association.getNext()) != null) {
+ ElemTemplate elemTemplate = association.getTemplate();
+ double pr = elemTemplate.getPriority();
+ if (pr < pDesired) {
+ String matchPattern2 = (elemTemplate.getMatch()).getPatternString();
+ if (matchPattern2.equals(matchPatternStr)) {
+ pDesired = pr;
+ desiredTemplate = elemTemplate;
+ }
+ }
+ }
+
+ if (desiredTemplate != null) {
+ xctxt.setSAXLocator(desiredTemplate);
+ transformer.pushElemTemplateElement(desiredTemplate);
+ desiredTemplate.execute(transformer);
+ }
+ }
+ else {
+ xctxt.setSAXLocator(t);
+ transformer.pushElemTemplateElement(t);
+ t.execute(transformer);
+ }
}
- finally
- {
- transformer.popElemTemplateElement();
+ finally {
+ transformer.popElemTemplateElement();
}
}
}
diff --git a/src/main/java/org/apache/xalan/templates/ElemNextMatch.java b/src/main/java/org/apache/xalan/templates/ElemNextMatch.java
new file mode 100644
index 000000000..62d90a65a
--- /dev/null
+++ b/src/main/java/org/apache/xalan/templates/ElemNextMatch.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+package org.apache.xalan.templates;
+
+import javax.xml.transform.TransformerException;
+
+import org.apache.xalan.res.XSLTErrorResources;
+import org.apache.xalan.transformer.TransformerImpl;
+
+/**
+ * Implementation of XSLT 3.0 xsl:next-match instruction.
+ *
+ * @see <a href="https://www.w3.org/TR/xslt-30/#element-next-match">next-match in XSLT 3.0 specification</a>
+ *
+ * @author Mukul Gandhi <mu...@apache.org>
+ *
+ * @xsl.usage advanced
+ */
+public class ElemNextMatch extends ElemTemplateElement
+{
+
+ private static final long serialVersionUID = -8730317226202081634L;
+
+ /**
+ * Get an int constant identifying the type of element.
+ * @see org.apache.xalan.templates.Constants
+ *
+ * @return Token ID for xsl:next-match element types
+ */
+ public int getXSLToken()
+ {
+ return Constants.ELEMNAME_NEXT_MATCH;
+ }
+
+ /**
+ * Return the node name.
+ *
+ * @return Element name
+ */
+ public String getNodeName()
+ {
+ return Constants.ELEMNAME_NEXT_MATCH_STRING;
+ }
+
+ /**
+ * Execute the xsl:next-match transformation.
+ *
+ * @param transformer non-null reference to the the current transform-time state.
+ *
+ * @throws TransformerException
+ */
+ public void execute(
+ TransformerImpl transformer)
+ throws TransformerException
+ {
+ // no op
+ }
+
+ /**
+ * Add a child to the child list.
+ * <!ELEMENT xsl:next-match EMPTY>
+ *
+ * @param newChild New element to append to this element's children list
+ *
+ * @return null, xsl:next-match cannot have children
+ */
+ public ElemTemplateElement appendChild(ElemTemplateElement newChild)
+ {
+
+ String lineNo = String.valueOf(newChild.getLineNumber());
+ String columnNo = String.valueOf(newChild.getColumnNumber());
+
+ error(XSLTErrorResources.ER_CANNOT_ADD,
+ new Object[]{ newChild.getNodeName(),
+ this.getNodeName(), lineNo, columnNo });
+
+ return null;
+ }
+}
diff --git a/src/test/java/org/apache/xalan/tests/main/XalanXsl3TestSuite2.java b/src/test/java/org/apache/xalan/tests/main/XalanXsl3TestSuite2.java
index 1eb3cb04d..28c05270b 100644
--- a/src/test/java/org/apache/xalan/tests/main/XalanXsl3TestSuite2.java
+++ b/src/test/java/org/apache/xalan/tests/main/XalanXsl3TestSuite2.java
@@ -85,6 +85,7 @@ import org.apache.xalan.tests.xslt3.XslLinearRegressionTests;
import org.apache.xalan.tests.xslt3.XslMergeTests;
import org.apache.xalan.tests.xslt3.XslMethodOutputJsonTests;
import org.apache.xalan.tests.xslt3.XslModeTests;
+import org.apache.xalan.tests.xslt3.XslNextMatchTests;
import org.apache.xalan.tests.xslt3.XslPackageTests;
import org.apache.xalan.tests.xslt3.XslPerformSortTests;
import org.apache.xalan.tests.xslt3.XslResultDocumentTests;
@@ -133,7 +134,7 @@ import org.junit.runners.Suite.SuiteClasses;
XPathTextAndNodePattern.class, XPathLiteralSequenceTests.class, XslModeTests.class, XslTemplatePriorityTests.class,
XslDisableOutputEscapingAttrTests.class, FnAdjustDatetimeToTimezoneTests.class,
FnAdjustDateToTimezoneTests.class, FnAdjustTimeToTimezoneTests.class, FnFormatIntegerTests.class, XslPerformSortTests.class,
- XslPackageTests.class, XslUseWhenTests.class, XslLinearRegressionTests.class } )
+ XslPackageTests.class, XslUseWhenTests.class, XslLinearRegressionTests.class, XslNextMatchTests.class } )
public class XalanXsl3TestSuite2 {
}
diff --git a/src/test/java/org/apache/xalan/tests/xslt3/XslNextMatchTests.java b/src/test/java/org/apache/xalan/tests/xslt3/XslNextMatchTests.java
new file mode 100644
index 000000000..308477529
--- /dev/null
+++ b/src/test/java/org/apache/xalan/tests/xslt3/XslNextMatchTests.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+package org.apache.xalan.tests.xslt3;
+
+import org.apache.xalan.tests.util.XSLTestConstants;
+import org.apache.xalan.tests.util.XslTransformTestsUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * XSL stylesheet test case to test, xsl:next-match instruction.
+ *
+ * @author Mukul Gandhi <mu...@apache.org>
+ *
+ * @xsl.usage advanced
+ */
+public class XslNextMatchTests extends XslTransformTestsUtil {
+
+ private static final String XSL_TRANSFORM_INPUT_DIRPATH = XSLTestConstants.XSL_TRANSFORM_INPUT_DIRPATH_PREFIX + "xsl_next_match/";
+
+ private static final String XSL_TRANSFORM_GOLD_DIRPATH = XSLTestConstants.XSL_TRANSFORM_GOLD_DIRPATH_PREFIX + "xsl_next_match/gold/";
+
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ // no op
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ m_xmlDocumentBuilderFactory = null;
+ m_xmlDocumentBuilder = null;
+ m_xslTransformerFactory = null;
+ }
+
+ @Test
+ public void xslNextMatchTest1() {
+ String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1.xml";
+ String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1.xsl";
+
+ String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test1.out";
+
+ runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+ }
+
+ @Test
+ public void xslNextMatchTest2() {
+ String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1.xml";
+ String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test2.xsl";
+
+ String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test2.out";
+
+ runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+ }
+
+}
diff --git a/src/test/resources/xsl_next_match/gold/test1.out b/src/test/resources/xsl_next_match/gold/test1.out
new file mode 100644
index 000000000..91e4c371f
--- /dev/null
+++ b/src/test/resources/xsl_next_match/gold/test1.out
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+ <aSelected/>
+ <aSelected priority="3"/>
+ <bSelected/>
+ <bSelected priority="3"/>
+ <cSelected priority="default"/>
+</result>
diff --git a/src/test/resources/xsl_next_match/gold/test2.out b/src/test/resources/xsl_next_match/gold/test2.out
new file mode 100644
index 000000000..2e76ef7b2
--- /dev/null
+++ b/src/test/resources/xsl_next_match/gold/test2.out
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+ <aSelected/>
+ <bSelected/>
+ <cSelected priority="default"/>
+</result>
diff --git a/src/test/resources/xsl_next_match/test1.xml b/src/test/resources/xsl_next_match/test1.xml
new file mode 100644
index 000000000..eed7d44da
--- /dev/null
+++ b/src/test/resources/xsl_next_match/test1.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <a/>
+ <b/>
+ <c/>
+</root>
\ No newline at end of file
diff --git a/src/test/resources/xsl_next_match/test1.xsl b/src/test/resources/xsl_next_match/test1.xsl
new file mode 100644
index 000000000..f55c4bf8f
--- /dev/null
+++ b/src/test/resources/xsl_next_match/test1.xsl
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="3.0">
+
+ <!-- Authors: mukulg@apache.org -->
+
+ <!-- use with test1.xml -->
+
+ <!-- An XSL 3 stylesheet test case, to test xsl:next-match instruction. -->
+
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:template match="/root">
+ <result>
+ <xsl:apply-templates select="a"/>
+ <xsl:apply-templates select="b"/>
+ <xsl:apply-templates select="c"/>
+ </result>
+ </xsl:template>
+
+ <xsl:template match="a" priority="2">
+ <aSelected/>
+ </xsl:template>
+
+ <xsl:template match="a" priority="3">
+ <xsl:next-match/>
+ <aSelected priority="3"/>
+ </xsl:template>
+
+ <xsl:template match="b" priority="2">
+ <bSelected/>
+ </xsl:template>
+
+ <xsl:template match="b" priority="3">
+ <xsl:next-match/>
+ <bSelected priority="3"/>
+ </xsl:template>
+
+ <xsl:template match="c">
+ <cSelected priority="default"/>
+ </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/src/test/resources/xsl_next_match/test2.xsl b/src/test/resources/xsl_next_match/test2.xsl
new file mode 100644
index 000000000..5b90b4402
--- /dev/null
+++ b/src/test/resources/xsl_next_match/test2.xsl
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="3.0">
+
+ <!-- Authors: mukulg@apache.org -->
+
+ <!-- use with test1.xml -->
+
+ <!-- An XSL 3 stylesheet test case, to test xsl:next-match instruction. -->
+
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:template match="/root">
+ <result>
+ <xsl:apply-templates select="a"/>
+ <xsl:apply-templates select="b"/>
+ <xsl:apply-templates select="c"/>
+ </result>
+ </xsl:template>
+
+ <xsl:template match="a" priority="2">
+ <aSelected/>
+ </xsl:template>
+
+ <xsl:template match="a" priority="3">
+ <xsl:next-match/>
+ </xsl:template>
+
+ <xsl:template match="b" priority="2">
+ <bSelected/>
+ </xsl:template>
+
+ <xsl:template match="b" priority="3">
+ <xsl:next-match/>
+ </xsl:template>
+
+ <xsl:template match="c">
+ <cSelected priority="default"/>
+ </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
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org