if ("parsererror".equals(DOMHelper.getLocalName(elt))) {
String message = "Parsing error";
if (elt.getFirstChild() != null) {
message = elt.getFirstChild().<Text>cast().getData();
}
throw new ParserException(ParserException.Type.NotWellFormed, message);
} else if ("html".equals(DOMHelper.getLocalName(elt))) {
String message = DOMHelper.evaluateStringXPath(elt, "./x:body/x:parsererror/x:div/text()", new XPathPrefixResolver() {
@Override
public String resolvePrefix(String prefix) {
if ("x".equals(prefix)) {
return "http://www.w3.org/1999/xhtml";
}
return null;
}
});
throw new ParserException(ParserException.Type.NotWellFormed, message);
}
SVGSVGElement svg = DOMHelper.importNode(DOMHelper.getCurrentDocument(), elt, true).cast();
// For some reason xlink:href are not correctly evaluated in
// some cases in mozilla. If one clones the node this seems
// to solve the problem