Hi Larry,
> I have defined some gradients inside a DEFS tag and use them in
> styles as fill:url(#gradientname1) This works great until someone
> adds a BASE HREF to the enclosing page that does not match the page
> as loaded from the server.
Humm... I haven't double check the whole SVG specification for sure regarding
this, but I assume you are creating inline SVG into HTML and therefore the
potential undefined behavior.
Whenever one experiences unexpected behavior, stating in which
implementation/environment is usually helpful: it could be an
implementation-specific bug. Also providing a test case and/or link where this
can be seen is also helpful [1]. ;-)
> How can I prevent this issue?
Without testing, I'd say you can use "xml:base" [2] in you top-level SVG
document to override HTML's "base". If that doesn't work, I'd say it's a bug!
:-)
Nevertheless, even if it works in a quick test, I'd advise you to test in more
than one implementation, as I have a slight feeling this may not work
cross-implementation. Just a tip...
> It should be noted that my SVG code is part of a javascript package
> that can be loaded into any folder within the web application's
> hierarchy (ie no hard code path info is possible).
Yes, that's a reasonable use-case.
> TIA,
> Larry
Hope this helps,
Helder
[1] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
[2] http://www.w3.org/TR/SVG/struct.html#Core.attrib