From 6f49f40ebe5d6a19ee9161723eeefe6512fe0e96 Mon Sep 17 00:00:00 2001 From: Kvarec Lezki Date: Tue, 23 Nov 2021 12:48:37 +0500 Subject: [PATCH] Fix assertion for XML without documentElement, but with elements --- src/xalanc/XPath/XPath.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xalanc/XPath/XPath.cpp b/src/xalanc/XPath/XPath.cpp index 6a32962f4..ab9cc436a 100644 --- a/src/xalanc/XPath/XPath.cpp +++ b/src/xalanc/XPath/XPath.cpp @@ -3537,6 +3537,12 @@ XPath::findRoot( } else { + if (DOMServices::getParentOfNode(*docContext) == 0 && + nodeType == XalanNode::ELEMENT_NODE) + { + // docContext is root node + break; + } docContext = DOMServices::getParentOfNode(*docContext); assert(docContext != 0);