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 2025/11/08 12:20:14 UTC
(xalan-java) branch xalan-j_xslt3.0_mvn updated: committing xalan-j xslt 3.0 implementation for xsl:template attribute mode's value #all
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 13933bc9a committing xalan-j xslt 3.0 implementation for xsl:template attribute mode's value #all
13933bc9a is described below
commit 13933bc9aa60879cd00ee6bf1d76b9e8b6588957
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Sat Nov 8 17:49:51 2025 +0530
committing xalan-j xslt 3.0 implementation for xsl:template attribute mode's value #all
---
.../apache/xalan/processor/XSLTAttributeDef.java | 19 +++++---
.../apache/xalan/templates/ElemApplyTemplates.java | 36 +++++++--------
.../org/apache/xalan/templates/ElemChoose.java | 2 +-
.../apache/xalan/templates/ElemForEachGroup.java | 2 +-
.../java/org/apache/xalan/templates/ElemIf.java | 2 +-
.../xalan/templates/ElemMatchingSubstring.java | 2 +-
.../xalan/templates/ElemNonMatchingSubstring.java | 2 +-
.../org/apache/xalan/templates/StylesheetRoot.java | 54 ++++++++++++++--------
.../templates/TemplateSubPatternAssociation.java | 14 ++++--
.../xslt/util/XslTransformEvaluationHelper.java | 4 +-
src/main/java/org/apache/xml/dtm/DTMManager.java | 12 ++---
.../xpath/axes/FilterExprIteratorSimple.java | 2 +-
.../xslt3/result/attr/_mode-test-set_result.xml | 16 +++----
.../result/w3c_xslt3_testsuite_xalan-j_result.xml | 4 +-
14 files changed, 98 insertions(+), 73 deletions(-)
diff --git a/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java b/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java
index b1ec8c365..9214cd40a 100644
--- a/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java
+++ b/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java
@@ -35,6 +35,7 @@ import org.apache.xalan.templates.AVT;
import org.apache.xalan.templates.Constants;
import org.apache.xalan.templates.ElemApplyTemplates;
import org.apache.xalan.templates.ElemForEachGroup;
+import org.apache.xalan.templates.ElemTemplate;
import org.apache.xalan.templates.ElemTemplateElement;
import org.apache.xalan.xslt.util.StringUtil;
import org.apache.xml.utils.NamespaceSupport2;
@@ -1043,22 +1044,28 @@ public class XSLTAttributeDef
}
else if ((owner instanceof ElemApplyTemplates) && (Constants.ATTRNAME_MODE).equals(name) &&
(Constants.ATTRVAL_DEFAULT_PREFIX).equals(value)) {
- // We use, an XML non-standard namespace for this QName
- // object, because string #default is not a valid QName string.
+ // We use, an XML non-standard namespace for this QName object
+ // instance, because string #default is not a valid QName string.
qname = new QName("http://xml.apache.org/xalan/java", "default", true);
}
else if ((owner instanceof ElemApplyTemplates) && (Constants.ATTRNAME_MODE).equals(name) &&
(Constants.ATTRVAL_UNNAMED_PREFIX).equals(value)) {
- // We use, an XML non-standard namespace for this QName
- // object, because string #unnamed is not a valid QName string.
+ // We use, an XML non-standard namespace for this QName object
+ // instance, because string #unnamed is not a valid QName string.
qname = new QName("http://xml.apache.org/xalan/java", "unnamed", true);
}
else if ((owner instanceof ElemApplyTemplates) && (Constants.ATTRNAME_MODE).equals(name) &&
(Constants.ATTRVAL_CURRENT_PREFIX).equals(value)) {
- // We use, an XML non-standard namespace for this QName
- // object, because string #current is not a valid QName string.
+ // We use, an XML non-standard namespace for this QName object
+ // instance, because string #current is not a valid QName string.
qname = new QName("http://xml.apache.org/xalan/java", "current", true);
}
+ else if ((owner instanceof ElemTemplate) && (Constants.ATTRNAME_MODE).equals(name) &&
+ (Constants.ATTRVAL_ALL_PREFIX).equals(value)) {
+ // We use, an XML non-standard namespace for this QName object
+ // instance, because string #all is not a valid QName string.
+ qname = new QName("http://xml.apache.org/xalan/java", "all", true);
+ }
else {
qname = new QName(value, handler, true);
}
diff --git a/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java b/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java
index 6f0d48f4c..99a516234 100644
--- a/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java
+++ b/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java
@@ -667,19 +667,19 @@ public class ElemApplyTemplates extends ElemCallTemplate
String nodeNameStr = dtm.getNodeName(child);
if (onNoMatchStr != null) {
if ((Constants.ATTRVAL_TEXT_ONLY_COPY).equals(onNoMatchStr)) {
- template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_DEEP_COPY).equals(onNoMatchStr)) {
template = sroot.getDeepCopyRule(elemMode.getName());
}
else if ((Constants.ATTRVAL_SHALLOW_COPY).equals(onNoMatchStr)) {
- template = sroot.getShallowCopyRule(elemMode.getName());
+ template = sroot.getShallowCopyRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_DEEP_SKIP).equals(onNoMatchStr)) {
- template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_SHALLOW_SKIP).equals(onNoMatchStr)) {
- template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_FAIL).equals(onNoMatchStr)) {
String errMesg = "XTDE0555 : An XSL template declaration could not be found to process an XML " + nodeTypeStr + " node";
@@ -724,19 +724,19 @@ public class ElemApplyTemplates extends ElemCallTemplate
String nodeNameStr = dtm.getNodeName(child);
if (onNoMatchStr != null) {
if ((Constants.ATTRVAL_TEXT_ONLY_COPY).equals(onNoMatchStr)) {
- template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_DEEP_COPY).equals(onNoMatchStr)) {
template = sroot.getDeepCopyRule(elemMode.getName());
}
else if ((Constants.ATTRVAL_SHALLOW_COPY).equals(onNoMatchStr)) {
- template = sroot.getShallowCopyRule(elemMode.getName());
+ template = sroot.getShallowCopyRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_DEEP_SKIP).equals(onNoMatchStr)) {
- template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_SHALLOW_SKIP).equals(onNoMatchStr)) {
- template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_FAIL).equals(onNoMatchStr)) {
String errMesg = "XTDE0555 : An XSL template declaration could not be found to process an XML " + nodeTypeStr + " node";
@@ -771,7 +771,7 @@ public class ElemApplyTemplates extends ElemCallTemplate
}
}
else {
- template = sroot.getTextOnlyCopyRule(null, nodeType, transformer.getCurrentMode());
+ template = sroot.getTextOnlyCopyRule(null, nodeType, mode);
serializeXdmStringValueWithDefaultXslTextRule(transformer, rth, sroot, dtm, child, template);
continue;
@@ -785,7 +785,7 @@ public class ElemApplyTemplates extends ElemCallTemplate
String nodeNameStr = dtm.getNodeName(child);
if (onNoMatchStr != null) {
if ((Constants.ATTRVAL_TEXT_ONLY_COPY).equals(onNoMatchStr)) {
- template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_DEEP_COPY).equals(onNoMatchStr)) {
template = sroot.getDeepCopyRule(elemMode.getName());
@@ -794,10 +794,10 @@ public class ElemApplyTemplates extends ElemCallTemplate
template = sroot.getDefaultTextRule();
}
else if ((Constants.ATTRVAL_DEEP_SKIP).equals(onNoMatchStr)) {
- template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_SHALLOW_SKIP).equals(onNoMatchStr)) {
- template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_FAIL).equals(onNoMatchStr)) {
String errMesg = "XTDE0555 : An XSL template declaration could not be found to process an XML " + nodeTypeStr + " node";
@@ -845,7 +845,7 @@ public class ElemApplyTemplates extends ElemCallTemplate
String nodeNameStr = dtm.getNodeName(child);
if (onNoMatchStr != null) {
if ((Constants.ATTRVAL_TEXT_ONLY_COPY).equals(onNoMatchStr)) {
- template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_DEEP_COPY).equals(onNoMatchStr)) {
template = sroot.getDeepCopyRule(elemMode.getName());
@@ -864,10 +864,10 @@ public class ElemApplyTemplates extends ElemCallTemplate
template.appendChild(elemCopyOf);
}
else if ((Constants.ATTRVAL_DEEP_SKIP).equals(onNoMatchStr)) {
- template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_SHALLOW_SKIP).equals(onNoMatchStr)) {
- template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_FAIL).equals(onNoMatchStr)) {
String errMesg = "XTDE0555 : An XSL template declaration could not be found to process an XML " + nodeTypeStr + " node";
@@ -905,7 +905,7 @@ public class ElemApplyTemplates extends ElemCallTemplate
String nodeNameStr = dtm.getNodeName(child);
if (onNoMatchStr != null) {
if ((Constants.ATTRVAL_TEXT_ONLY_COPY).equals(onNoMatchStr)) {
- template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getTextOnlyCopyRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_DEEP_COPY).equals(onNoMatchStr)) {
template = sroot.getDeepCopyRule(elemMode.getName());
@@ -924,10 +924,10 @@ public class ElemApplyTemplates extends ElemCallTemplate
template.appendChild(elemCopyOf);
}
else if ((Constants.ATTRVAL_DEEP_SKIP).equals(onNoMatchStr)) {
- template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getDeepSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_SHALLOW_SKIP).equals(onNoMatchStr)) {
- template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, transformer.getCurrentMode());
+ template = sroot.getShallowSkipRule(elemMode.getName(), nodeType, mode);
}
else if ((Constants.ATTRVAL_FAIL).equals(onNoMatchStr)) {
String errMesg = "XTDE0555 : An XSL template declaration could not be found to process an XML " + nodeTypeStr + " node";
diff --git a/src/main/java/org/apache/xalan/templates/ElemChoose.java b/src/main/java/org/apache/xalan/templates/ElemChoose.java
index 3e01c0b76..f07962654 100644
--- a/src/main/java/org/apache/xalan/templates/ElemChoose.java
+++ b/src/main/java/org/apache/xalan/templates/ElemChoose.java
@@ -207,7 +207,7 @@ public class ElemChoose extends ElemTemplateElement
else {
strVal = xpath3ContextItem.str();
}
- DTM docFragDtm = dtmMgr.constructShallowXmlDTMTree(strVal, null, null);
+ DTM docFragDtm = dtmMgr.getXmlShallowDTMTree(strVal, null, null);
int contextNode = docFragDtm.getFirstChild(docFragDtm.getDocument());
xctxtNew.pushCurrentNode(contextNode);
diff --git a/src/main/java/org/apache/xalan/templates/ElemForEachGroup.java b/src/main/java/org/apache/xalan/templates/ElemForEachGroup.java
index 6a6b02157..820bbc855 100644
--- a/src/main/java/org/apache/xalan/templates/ElemForEachGroup.java
+++ b/src/main/java/org/apache/xalan/templates/ElemForEachGroup.java
@@ -674,7 +674,7 @@ public class ElemForEachGroup extends ElemTemplateElement
// Construct an XML DOM wrapper over a sequence of input
// atomic values, for the purpose of grouping
- DTM dtm = dtmManager.constructXmlDTMTreeFromResultSequence(resultSeq);
+ DTM dtm = dtmManager.getXmlDTMTreeFromResultSequence(resultSeq);
int docNodeHandle = dtm.getDocument();
int topMostElemNodeHandle = dtm.getFirstChild(docNodeHandle);
diff --git a/src/main/java/org/apache/xalan/templates/ElemIf.java b/src/main/java/org/apache/xalan/templates/ElemIf.java
index e4eb824b9..37dcbd967 100644
--- a/src/main/java/org/apache/xalan/templates/ElemIf.java
+++ b/src/main/java/org/apache/xalan/templates/ElemIf.java
@@ -250,7 +250,7 @@ public class ElemIf extends ElemTemplateElement
else {
strVal = xpath3ContextItem.str();
}
- DTM docFragDtm = dtmMgr.constructShallowXmlDTMTree(strVal, null, null);
+ DTM docFragDtm = dtmMgr.getXmlShallowDTMTree(strVal, null, null);
int contextNode = docFragDtm.getFirstChild(docFragDtm.getDocument());
xctxtNew.pushCurrentNode(contextNode);
diff --git a/src/main/java/org/apache/xalan/templates/ElemMatchingSubstring.java b/src/main/java/org/apache/xalan/templates/ElemMatchingSubstring.java
index 1ef260aad..a97f02ade 100644
--- a/src/main/java/org/apache/xalan/templates/ElemMatchingSubstring.java
+++ b/src/main/java/org/apache/xalan/templates/ElemMatchingSubstring.java
@@ -208,7 +208,7 @@ public class ElemMatchingSubstring extends ElemTemplateElement implements Expres
xctxtNew.setLast(xctxt.getLast());
DTMManager dtmMgr = xctxtNew.getDTMManager();
- DTM docFragDtm = dtmMgr.constructShallowXmlDTMTree(strValueTobeEvaluated, null, null);
+ DTM docFragDtm = dtmMgr.getXmlShallowDTMTree(strValueTobeEvaluated, null, null);
int contextNode = docFragDtm.getFirstChild(docFragDtm.getDocument());
diff --git a/src/main/java/org/apache/xalan/templates/ElemNonMatchingSubstring.java b/src/main/java/org/apache/xalan/templates/ElemNonMatchingSubstring.java
index bb12e3b2b..0ea19f0af 100644
--- a/src/main/java/org/apache/xalan/templates/ElemNonMatchingSubstring.java
+++ b/src/main/java/org/apache/xalan/templates/ElemNonMatchingSubstring.java
@@ -191,7 +191,7 @@ public class ElemNonMatchingSubstring extends ElemTemplateElement implements Exp
xctxtNew.setLast(xctxt.getLast());
DTMManager dtmMgr = xctxtNew.getDTMManager();
- DTM docFragDtm = dtmMgr.constructShallowXmlDTMTree(strValueTobeEvaluated, null, null);
+ DTM docFragDtm = dtmMgr.getXmlShallowDTMTree(strValueTobeEvaluated, null, null);
int contextNode = docFragDtm.getFirstChild(docFragDtm.getDocument());
diff --git a/src/main/java/org/apache/xalan/templates/StylesheetRoot.java b/src/main/java/org/apache/xalan/templates/StylesheetRoot.java
index 2e81a7569..e48560e46 100644
--- a/src/main/java/org/apache/xalan/templates/StylesheetRoot.java
+++ b/src/main/java/org/apache/xalan/templates/StylesheetRoot.java
@@ -1182,35 +1182,51 @@ public class StylesheetRoot extends StylesheetComposed
* Method definition, to get an XSL stylesheet shallow copy template rule.
*
* @param mode An XSL template mode value
+ * @param nodeType Node type value
+ * @param currentMode Current mode value
* @return An xsl:template declaration
* object for an XSL stylesheet rule.
* @throws TransformerException
*/
- public ElemTemplate getShallowCopyRule(QName mode) throws TransformerException
+ public ElemTemplate getShallowCopyRule(QName mode, int nodeType, QName currentMode) throws TransformerException
{
ElemTemplate result = new ElemTemplate();
result.setMode(mode);
- result.setStylesheet(this);
-
- XPath xpathMatch = new XPath("node()|@*", this, this, XPath.MATCH, m_errorListener);
- result.setMatch(xpathMatch);
-
- ElemCopy elemCopy = new ElemCopy();
+ result.setStylesheet(this);
- ElemCopyOf elemCopyOf = new ElemCopyOf();
- XPath xpathSelect = new XPath("@*", this, this, XPath.SELECT, m_errorListener);
- elemCopyOf.setSelect(xpathSelect);
- elemCopy.appendChild(elemCopyOf);
-
- ElemApplyTemplates elemApplyTemplates = new ElemApplyTemplates();
- elemApplyTemplates.setMode(mode);
- xpathSelect = new XPath("node()", this, this, XPath.SELECT, m_errorListener);
- elemApplyTemplates.setSelect(xpathSelect);
- elemApplyTemplates.setIsDefaultTemplate(true);
- elemCopy.appendChild(elemApplyTemplates);
+ if (nodeType == DTM.ATTRIBUTE_NODE) {
+ XPath xpathMatch = new XPath("@*", this, this, XPath.MATCH, m_errorListener);
+ result.setMatch(xpathMatch);
+
+ ElemCopyOf elemCopyOf = new ElemCopyOf();
+ XPath xpathSelect = new XPath(".", this, this, XPath.SELECT, m_errorListener);
+ elemCopyOf.setSelect(xpathSelect);
+
+ result.appendChild(elemCopyOf);
+ }
+ else {
+ ElemCopy elemCopy = new ElemCopy();
+
+ XPath xpathMatch = new XPath("node()", this, this, XPath.MATCH, m_errorListener);
+ result.setMatch(xpathMatch);
- result.appendChild(elemCopy);
+ ElemApplyTemplates elemApplyTemplates = new ElemApplyTemplates();
+ elemApplyTemplates.setMode(mode);
+ XPath xpathSelect = new XPath("@*", this, this, XPath.SELECT, m_errorListener);
+ elemApplyTemplates.setSelect(xpathSelect);
+ elemApplyTemplates.setIsDefaultTemplate(true);
+ elemCopy.appendChild(elemApplyTemplates);
+
+ elemApplyTemplates = new ElemApplyTemplates();
+ elemApplyTemplates.setMode(mode);
+ xpathSelect = new XPath("node()", this, this, XPath.SELECT, m_errorListener);
+ elemApplyTemplates.setSelect(xpathSelect);
+ elemApplyTemplates.setIsDefaultTemplate(true);
+ elemCopy.appendChild(elemApplyTemplates);
+
+ result.appendChild(elemCopy);
+ }
return result;
}
diff --git a/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java b/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java
index bd195cf1f..0be074c09 100644
--- a/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java
+++ b/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java
@@ -68,12 +68,12 @@ public class TemplateSubPatternAssociation implements Serializable, Cloneable
m_stepPattern = pattern;
if (m_stepPattern != null) {
m_targetString = m_stepPattern.getTargetString();
- m_wild = m_targetString.equals("*");
}
else {
- m_targetString = m_pattern;
- m_wild = m_targetString.equals("*");
+ m_targetString = m_pattern;
}
+
+ m_wild = m_targetString.equals("*");
}
/**
@@ -140,9 +140,13 @@ public class TemplateSubPatternAssociation implements Serializable, Cloneable
{
boolean result = false;
- QName defaultMode = new QName("http://xml.apache.org/xalan/java", "default", true);
+ QName defaultMode = new QName("http://xml.apache.org/xalan/java", "default", true);
+ QName modeAll = new QName("http://xml.apache.org/xalan/java", "all", true);
- if ((m1 == null) && (m2 == null)) {
+ if (modeAll.equals(m2)) {
+ result = true;
+ }
+ else if ((m1 == null) && (m2 == null)) {
result = true;
}
else if ((m1 == null) && defaultMode.equals(m2)) {
diff --git a/src/main/java/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java b/src/main/java/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java
index b4c066e00..825b0a75e 100644
--- a/src/main/java/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java
+++ b/src/main/java/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java
@@ -318,7 +318,7 @@ public class XslTransformEvaluationHelper {
}
else if (xObj instanceof XdmAttributeItem) {
XdmAttributeItem xdmAttributeItem = (XdmAttributeItem)xObj;
- DTM dtm = dtmMgr.constructShallowXmlDTMTree(null, xdmAttributeItem, null);
+ DTM dtm = dtmMgr.getXmlShallowDTMTree(null, xdmAttributeItem, null);
int docNodeHandle = dtm.getDocument();
int docElemHandle = dtm.getFirstChild(docNodeHandle);
String attrNamespace = xdmAttributeItem.getAttrNodeNs();
@@ -328,7 +328,7 @@ public class XslTransformEvaluationHelper {
}
else if (xObj instanceof XdmNamespaceItem) {
XdmNamespaceItem xdmNamespaceItem = (XdmNamespaceItem)xObj;
- DTM dtm = dtmMgr.constructShallowXmlDTMTree(null, null, xdmNamespaceItem);
+ DTM dtm = dtmMgr.getXmlShallowDTMTree(null, null, xdmNamespaceItem);
int docNodeHandle = dtm.getDocument();
int docElemHandle = dtm.getFirstChild(docNodeHandle);
String localName = xdmNamespaceItem.getNamespaceNodeName();
diff --git a/src/main/java/org/apache/xml/dtm/DTMManager.java b/src/main/java/org/apache/xml/dtm/DTMManager.java
index 7f6e24115..2f65c9813 100644
--- a/src/main/java/org/apache/xml/dtm/DTMManager.java
+++ b/src/main/java/org/apache/xml/dtm/DTMManager.java
@@ -242,8 +242,8 @@ public abstract class DTMManager
* @return The constructed DTM object instance
*
*/
- public DTM constructShallowXmlDTMTree(String textNodeStrValue, XdmAttributeItem xdmAttributeItem,
- XdmNamespaceItem xdmNamespaceItem) {
+ public DTM getXmlShallowDTMTree(String textNodeStrValue, XdmAttributeItem xdmAttributeItem,
+ XdmNamespaceItem xdmNamespaceItem) {
try {
System.setProperty(Constants.XML_DOCUMENT_BUILDER_FACTORY_KEY, Constants.XML_DOCUMENT_BUILDER_FACTORY_VALUE);
@@ -262,7 +262,7 @@ public abstract class DTMManager
*/
long currentTimeMills = System.currentTimeMillis();
String elemNameSuffix = (Long.valueOf(currentTimeMills)).toString();
- elemNameSuffix = elemNameSuffix.substring(0, 5); // Represents string value with length 5
+ elemNameSuffix = elemNameSuffix.substring(0, 5);
Element elem1 = document.createElement("elem_" + elemNameSuffix);
@@ -310,7 +310,7 @@ public abstract class DTMManager
* @param rSeq The supplied xdm sequence object
* @return The constructed DTM object instance
*/
- public DTM constructXmlDTMTreeFromResultSequence(ResultSequence rSeq) {
+ public DTM getXmlDTMTreeFromResultSequence(ResultSequence rSeq) {
try {
System.setProperty(Constants.XML_DOCUMENT_BUILDER_FACTORY_KEY, Constants.XML_DOCUMENT_BUILDER_FACTORY_VALUE);
@@ -323,8 +323,8 @@ public abstract class DTMManager
// We form, XML element temporary names, here
String str1 = String.valueOf(System.currentTimeMillis());
- String docElemName = "a_" + str1.substring(0, 5); // Represents string value with length 5
- String childElemName = "b_" + str1.substring(0, 5); // Represents string value with length 5
+ String docElemName = "a_" + str1.substring(0, 5);
+ String childElemName = "b_" + str1.substring(0, 5);
Element docElem = document.createElement(docElemName);
int rSeqLength = rSeq.size();
diff --git a/src/main/java/org/apache/xpath/axes/FilterExprIteratorSimple.java b/src/main/java/org/apache/xpath/axes/FilterExprIteratorSimple.java
index c32d83a9d..a401f8bc7 100644
--- a/src/main/java/org/apache/xpath/axes/FilterExprIteratorSimple.java
+++ b/src/main/java/org/apache/xpath/axes/FilterExprIteratorSimple.java
@@ -146,7 +146,7 @@ public class FilterExprIteratorSimple extends LocPathIterator
Object obj1 = null;
if ((exprEvalResult instanceof ResultSequence) && XslTransformEvaluationHelper.isSequenceContainsAllXDMAtomicValues((ResultSequence)exprEvalResult)) {
DTMManager dtmMgr = xctxt.getDTMManager();
- DTM dtm = dtmMgr.constructXmlDTMTreeFromResultSequence((ResultSequence)exprEvalResult);
+ DTM dtm = dtmMgr.getXmlDTMTreeFromResultSequence((ResultSequence)exprEvalResult);
int docNodeHandle = dtm.getDocument();
int docElemHandle = dtm.getFirstChild(docNodeHandle);
int nextNode = dtm.getFirstChild(docElemHandle);
diff --git a/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/attr/_mode-test-set_result.xml b/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/attr/_mode-test-set_result.xml
index 36e0ac9b6..e42d761b2 100644
--- a/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/attr/_mode-test-set_result.xml
+++ b/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/attr/_mode-test-set_result.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?><testrun dateTime="2025-11-07T11:25:18Z" fail="70" name="mode" pass="48" skipped="25" statusUnknown="0" totalRun="118">
+<?xml version="1.0" encoding="UTF-8"?><testrun dateTime="2025-11-08T12:12:43Z" fail="65" name="mode" pass="53" skipped="25" statusUnknown="0" totalRun="118">
<testResult status="pass" testName="mode-0001"/>
<testResult feature="streaming" status="skipped" testName="mode-0002"/>
<testResult status="pass" testName="mode-0003"/>
@@ -9,11 +9,11 @@
<testResult feature="streaming" status="skipped" testName="mode-0008"/>
<testResult status="pass" testName="mode-0009"/>
<testResult feature="streaming" status="skipped" testName="mode-0010"/>
- <testResult status="fail" testName="mode-0011"/>
+ <testResult status="pass" testName="mode-0011"/>
<testResult feature="streaming" status="skipped" testName="mode-0012"/>
<testResult status="pass" testName="mode-0013"/>
<testResult feature="streaming" status="skipped" testName="mode-0014"/>
- <testResult status="fail" testName="mode-0015"/>
+ <testResult status="pass" testName="mode-0015"/>
<testResult status="fail" testName="mode-0016"/>
<testResult status="pass" testName="mode-0101"/>
<testResult status="pass" testName="mode-0102"/>
@@ -76,9 +76,7 @@
</testResult>
<testResult status="fail" testName="mode-1103"/>
<testResult status="fail" testName="mode-1104">
- <outResult>
- <errTrace>Illegal value: #all used for QNAME attribute: mode</errTrace>
- </outResult>
+ <outResult/>
</testResult>
<testResult status="fail" testName="mode-1105">
<outResult/>
@@ -130,11 +128,11 @@ Z #unnamed used for QNAME attribute: mode</errTrace>
<errTrace>XTSE0010 : xsl:apply-templates is not allowed in this position in the stylesheet</errTrace>
</outResult>
</testResult>
- <testResult status="fail" testName="mode-1201"/>
+ <testResult status="pass" testName="mode-1201"/>
<testResult status="pass" testName="mode-1202"/>
- <testResult status="fail" testName="mode-1203"/>
+ <testResult status="pass" testName="mode-1203"/>
<testResult status="fail" testName="mode-1204"/>
- <testResult status="fail" testName="mode-1301"/>
+ <testResult status="pass" testName="mode-1301"/>
<testResult status="fail" testName="mode-1401"/>
<testResult status="pass" testName="mode-1402"/>
<testResult status="fail" testName="mode-1403"/>
diff --git a/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/w3c_xslt3_testsuite_xalan-j_result.xml b/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/w3c_xslt3_testsuite_xalan-j_result.xml
index 71c495a18..7ad6d6c1a 100644
--- a/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/w3c_xslt3_testsuite_xalan-j_result.xml
+++ b/src/test/java/org/apache/xalan/tests/w3c/xslt3/result/w3c_xslt3_testsuite_xalan-j_result.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<testResult dateTime="2025-11-07T11:25:36Z" desc="W3C XSLT 3.0 test suite results" fail="643" pass="1864" skipped="160" success="73.91%" totalRun="2522" xslt_processor="Xalan-J XSLT 3.0 development code">
+<testResult dateTime="2025-11-08T12:13:00Z" desc="W3C XSLT 3.0 test suite results" fail="638" pass="1869" skipped="160" success="74.11%" totalRun="2522" xslt_processor="Xalan-J XSLT 3.0 development code">
<attr>
<as fail="24" pass="79" skipped="5" success="75.96%" totalRun="104"/>
<avt fail="14" pass="21" skipped="0" success="60.0%" totalRun="35"/>
<expand-text fail="8" pass="51" skipped="3" success="86.44%" totalRun="59"/>
<match fail="51" pass="74" skipped="11" success="58.73%" totalRun="126"/>
- <mode fail="70" pass="48" skipped="25" success="40.68%" totalRun="118"/>
+ <mode fail="65" pass="53" skipped="25" success="44.92%" totalRun="118"/>
<select fail="3" pass="25" skipped="0" success="86.21%" totalRun="29"/>
<xpath-default-namespace fail="11" pass="11" skipped="4" success="50.0%" totalRun="22"/>
</attr>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org