|
24 | 24 | import com.xmlcalabash.model.PipeNameBinding; |
25 | 25 | import com.xmlcalabash.model.RuntimeValue; |
26 | 26 | import com.xmlcalabash.model.Step; |
27 | | -import com.xmlcalabash.util.AxisNodes; |
28 | | -import com.xmlcalabash.util.MessageFormatter; |
29 | | -import com.xmlcalabash.util.S9apiUtils; |
30 | | -import com.xmlcalabash.util.TypeUtils; |
| 27 | +import com.xmlcalabash.util.*; |
31 | 28 | import net.sf.saxon.om.NamespaceMap; |
32 | 29 | import net.sf.saxon.om.NamespaceUri; |
33 | 30 | import net.sf.saxon.s9api.Axis; |
@@ -706,7 +703,7 @@ protected RuntimeValue computeValue(ComputableValue var) { |
706 | 703 | Throwable sae = saue.getCause(); |
707 | 704 | if (sae instanceof XPathException) { |
708 | 705 | XPathException xe = (XPathException) sae; |
709 | | - if ("http://www.w3.org/2005/xqt-errors".equals(xe.getErrorCodeNamespace()) && "XPDY0002".equals(xe.getErrorCodeLocalPart())) { |
| 706 | + if (QNameUtils.hasForm(xe.getErrorCodeQName(), "http://www.w3.org/2005/xqt-errors", "XPDY0002")) { |
710 | 707 | throw XProcException.dynamicError(26, step.getNode(), "The expression for $" + var.getName() + " refers to the context item."); |
711 | 708 | } else { |
712 | 709 | throw saue; |
@@ -828,7 +825,7 @@ protected Vector<XdmItem> evaluateXPath(XdmNode doc, HashMap<String,NamespaceUri |
828 | 825 | Throwable sae = saue.getCause(); |
829 | 826 | if (sae instanceof XPathException) { |
830 | 827 | XPathException xe = (XPathException) sae; |
831 | | - if ("http://www.w3.org/2005/xqt-errors".equals(xe.getErrorCodeNamespace()) && "XPDY0002".equals(xe.getErrorCodeLocalPart())) { |
| 828 | + if (QNameUtils.hasForm(xe.getErrorCodeQName(), "http://www.w3.org/2005/xqt-errors", "XPDY0002")) { |
832 | 829 | throw XProcException.dynamicError(26, step.getNode(), "Expression refers to context when none is available: " + xpath); |
833 | 830 | } else { |
834 | 831 | throw saue; |
|
0 commit comments