Permalink
Browse files

Fix issue #107 make sure the prefix associated with an error code is …

…declared
  • Loading branch information...
ndw committed Jul 25, 2013
1 parent 0d910cd commit 49e961e52e6ac83f470ccef25b197feebb90eed5
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/com/xmlcalabash/util/StepErrorListener.java
@@ -74,7 +74,6 @@ private boolean report(String type, TransformerException exception) {
writer.startDocument(baseURI);
writer.addStartElement(c_error);
- writer.addAttribute(_type, type);
String message = exception.toString();
StructuredQName qCode = null;
@@ -95,9 +94,12 @@ private boolean report(String type, TransformerException exception) {
qCode = ((XPathException) exception.getException()).getErrorCodeQName();
}
if (qCode != null) {
+ writer.addNamespace(qCode.getPrefix(), qCode.getNamespaceBinding().getURI());
writer.addAttribute(_code, qCode.getDisplayName());
}
+ writer.addAttribute(_type, type);
+
if (exception.getLocator() != null) {
SourceLocator loc = exception.getLocator();
boolean done = false;

0 comments on commit 49e961e

Please sign in to comment.