URL baseURL = ((SVGOMDocument)svgDoc).getURLObject();
URL url = null;
try {
url = new URL(baseURL, uriStr);
} catch (MalformedURLException mue) {
throw new IllegalAttributeValueException(
Messages.formatMessage("feImage.xlinkHref.badURL", null));
}
try {
URIResolver ur =
new URIResolver(svgDoc, bridgeContext.getDocumentLoader());
Node refNode = ur.getNode(url.toString());
if (refNode == null) {
throw new IllegalAttributeValueException(
Messages.formatMessage("feImage.xlinkHref.badURL",
null));
}
Element refElement;
if (refNode.getNodeType() == refNode.DOCUMENT_NODE) {
refElement = ((SVGDocument)refNode).getRootElement();
} else {
refElement = (Element)refNode;
}
// Cannot access referenced file...
if(refElement == null){
throw new IllegalAttributeValueException(
Messages.formatMessage("feImage.xlinkHref.badURL",
null));
}
GraphicsNode gn =