String href = XLinkSupport.getXLinkHref(elt);
if (show.equals("new")) {
fireLinkActivatedEvent(elt, href);
if (svgUserAgent != null) {
String oldURI = svgDocument.getURL();
ParsedURL newURI = null;
// if the anchor element is in an external resource
if (elt.getOwnerDocument() != svgDocument) {
SVGDocument doc = (SVGDocument)elt.getOwnerDocument();
href = new ParsedURL(doc.getURL(), href).toString();
}
newURI = new ParsedURL(oldURI, href);
href = newURI.toString();
svgUserAgent.openLink(href, true);
} else {
JSVGComponent.this.loadSVGDocument(href);
}
return;
}
// Always use anchor element's document for base URI,
// for when it comes from an external resource.
ParsedURL newURI = new ParsedURL
(((SVGDocument)elt.getOwnerDocument()).getURL(), href);
// replace href with a fully resolved URI.
href = newURI.toString();
// Avoid reloading if possible.
if (svgDocument != null) {
ParsedURL oldURI = new ParsedURL(svgDocument.getURL());
// Check if they reference the same file.
if (newURI.sameFile(oldURI)) {
// They do, see if it's a new Fragment Ident.
String s = newURI.getRef();
if ((fragmentIdentifier != s) &&