Commit fc7f0b60 authored by peter's avatar peter
Browse files

a couple fixes for XmlTagImpl.getNamespaceByPrefix:

don't go for expensive ns descriptors if that won't affect the result anyway
prevent only really endless recursion
parent 75705c97
Showing with 3 additions and 1 deletion
+3 -1
......@@ -795,8 +795,10 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag, HintedReferenc
// When there is no namespace declarations then qualified names should be just used in dtds
// this implies that we may have "" namespace prefix ! (see last paragraph in Namespaces in Xml, Section 5)
String result = ourGuard.doPreventingRecursion("getNsByPrefix", true, () -> {
String result = ourGuard.doPreventingRecursion(Trinity.create("getNsByPrefix", this, prefix), true, () -> {
final String nsFromEmptyPrefix = getNamespaceByPrefix("");
if (nsFromEmptyPrefix.isEmpty()) return nsFromEmptyPrefix;
final XmlNSDescriptor nsDescriptor = getNSDescriptor(nsFromEmptyPrefix, false);
final XmlElementDescriptor descriptor = nsDescriptor != null ? nsDescriptor.getElementDescriptor(this) : null;
final String nameFromRealDescriptor =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment