Linking
From Svg wiki
Where is Linking covered in the SVG specification?
Linking is covered in section 17 (http://www.w3.org/TR/SVG/linking.html) of the SVG specification.
How can I change the page in one frame from an SVG in another frame?
The <a> element defines a "target" attribute. Setting this attribute to the name of a frame will cause the link to set that frame's contents. For example:
<a xlink:href="General.xml" target="Center">
<text x="20" y="32" style="&st1;">
General
</text>
</a>
The above will set the contents of a frame called "Center" to the file "General.xml".
How are partial URLs resolved?
The spec states (http://www.w3.org/TR/SVG/struct.html#uriReferenceDefinition) that relative resources are resolved according to the XmlBase (http://www.w3.org/TR/xmlbase/#resolution) recommendation. In particular: The base URI of a document entity or an external entity is determined by RFC 2396 rules, namely, that the base URI is the URI used to retrieve the document entity or external entity.
Alas! My experiments seem to indicate that, for Adobe SVG Viewer at least, the base URL is taken as being that of the HTML document containing the SVG document, not the SVG document itself. This prevents embedded images or links from working if the containing document has a different relativePath. For example, I had
index.html pdc/tarot/index.html pdc/tarot/wands.svgz pdc/tarot/wands-ace-100w.png
The HTML files had an <object> element referring to the SVG document, which has an <image> element linked to the PNG. This worked fine when visiting the HTML page in the same directory, but failed for the one in the root directory.
The XmlBase recommendation also mandates an attribute <xml:base> that sets the base URL of an XML document or XML element. I have tried using this but neither Adobe SVG Viewer nor Batik seem to take any notice of it. — Damian Cugley
