The actual problem:
I'm trying to display an SVG image in a JSVGCanvas, but the result is 
that part of it shows up, but the other part shows up as what's go to 
be basically an 'error' message from Batik, namely a picture of a 
piece of paper with the Batik logo and a large split in the middle, 
with a yellow-filled circle surrounding an 'i'.  However, this same 
exact SVG will open and perform in an external SVG program (Inkscape) 
as expected.

I have an SVG file that is wrapping a PNG via xlink:href=[filename].  
I can load this image in perfectly and display it.  Per the 
PrettyPrinter, the document that is displaying perfectly is:

<svg contentScriptType="text/ecmascript" width="222"
     xmlns:xlink="http://www.w3.org/1999/xlink";
     xmlns:svg="http://www.w3.org/2000/svg"; zoomAndPan="magnify"
     contentStyleType="text/css" id="svg2" height="399"
     preserveAspectRatio="xMidYMid meet" 
xmlns="http://www.w3.org/2000/svg";
     version="1.0">
    <defs id="defs4"/>
    <g id="layer1">
        <image x="0" y="0" width="222"
               xmlns:xlink="http://www.w3.org/1999/xlink";
               xlink:href="fixtures2.png" xlink:type="simple"
               xlink:actuate="onLoad" id="image11044" height="399"
               preserveAspectRatio="xMidYMid meet" 
xlink:show="embed"/>
    </g>
</svg>

Now, I want to display a border around it before displaying it.  I 
modify the DOM in code, and get the resulting SVG that gives 
the "bad" image described above:

<svg contentScriptType="text/ecmascript" width="680"
     xmlns:xlink="http://www.w3.org/1999/xlink"; zoomAndPan="magnify"
     contentStyleType="text/css" height="520"
     preserveAspectRatio="xMidYMid meet" 
xmlns="http://www.w3.org/2000/svg";
     version="1.0">
    <rect x="0" width="680" height="520" y="0"
          
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:5"/>
    <defs id="defs4"/>
    <g id="layer1">
        <image x="0" y="0" width="222"
               xmlns:xlink="http://www.w3.org/1999/xlink";
               xlink:href="fixtures2.png" xlink:type="simple"
               xlink:actuate="onLoad" height="399" id="image11044"
               preserveAspectRatio="xMidYMid meet" 
xlink:show="embed"/>
    </g>
</svg>

Now, there are only two differences between these two SVGs that I can 
see (and keep in mind these both open correctly in an external 
viewer):

1) an 'xmlns:svg="http://www.w3.org/2000/svg";' attribute
2) Dimensions
3) The obvious 'rect' element

I've deduced that #1 can't be the issue (or at least the only issue), 
because I can create other "pure" SVG files (no links) that do not 
have that attribute and are shown perfectly.

So... what the heck am I doing wrong?  I can attach the picture of the 
Batik graphic I'm being shown if nobody knows what I'm talking about, 
but I don't know if the list accepts them.  I can also post code if 
need be, but this *seems* to be an issue of how Batik interacts with 
SVG itself.

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to