I followed the instructions (with some additional detail from other sources) from How do I superimpose one SVG image onto another using Apache Batik?
Things are working perfectly most of the time, until now. Now, however, each of my individual svg documents (images) have clip paths. When I place 2 or more images, only the second path is saved in the output. I lose all other clip paths. Is there something I need to do to preserve the clip paths of each image? I looked at the SVG output, and see only one clip path. My code looks like this:
public void PlaceSVGImage(SVGDocument a, Point C)
{
String xatt = String.format("%f", C.X);
String yatt = String.format("%f", C.Y);
org.w3c.dom.Node ae = SVGC.SVGD.importNode(a.getDocumentElement(), true);
((Element) ae).removeAttribute("viewBox");
((Element) ae).setAttribute("x", xatt);
((Element) ae).setAttribute("y", yatt);
if (FIRSTCHILD)
{
SVGC.SVGD.getDocumentElement().appendChild(ae);
FIRSTCHILD = false;
NullNode = ae;
}
else
{
SVGC.SVGD.getDocumentElement().insertBefore(ae, NullNode);
}
}
I then use some standard code to display the SVGC.SVGD.
Any insight would be appreciated.