xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J B <moa...@gmail.com>
Subject <use> a reference from the classpath
Date Sat, 11 Feb 2006 17:51:50 GMT
I would like to place several reusable resources in the def section of an
svg file that will be bundled within my deployed jar file.  I would like to
reference the resources in this SVG from within another svg file using the
<use> element.

library.svg

<svg contentScriptType="text/ecmascript"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            xmlns="http://www.w3.org/2000/svg" version="1.0">
    <defs>
        <g id="lib1">
            <polygon fill="#CC6600" points="0,28 26,28 40,14 26,0 0,0 "/>
            <polygon points="4,24 24,24 34,14 24,4 4,4 "/>
        </g>
    </defs>
</svg>

test.xvg

<svg contentScriptType="text/ecmascript"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            xmlns="http://www.w3.org/2000/svg" version="1.0">
    <g>
        <use id="foo" xlink:href="jar:!/com/proteus/svg/library.svg#lib1"/>
    </g>
</svg>

I need to access the library.svg like I would any other resource in java.
Since it is bundled within hte same jar, I don't want to have to specify an
actual jar file.

Any thoughts?

Birch

Mime
View raw message