xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Siino <DSi...@Intellitrans.com>
Subject Adding a proccessing instruction
Date Wed, 14 Jul 2004 19:44:25 GMT


This has been mentioned in 2 previous posts: 




but it still doesn't work for me. Here's the code


DOMImplementation domImpl = SVGDOMImplementation.getDOMImplementation();

String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;

Document document = domImpl.createDocument(svgNS, "svg", null);

String strPI = ("type=\"text/css\" href=\"css/svgstyle.css\" ");

ProcessingInstruction pi =
document.createProcessingInstruction("xml-stylesheet", strPI);

document.insertBefore(pi, document.getDocumentElement() );


and here's the result as displayed by view SVG source in IE (with Adobe
plug-in version 3 and 6)


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'

<svg style="stroke-dasharray:none; .... >

  <defs id="genericDefs" />


    <g style="fill:aqua; stroke:aqua;">

      <rect x="5" y="5" width="600" style="fill:none;" height="400" />





The content is generated using 

svggen.stream(svgOutput, true); but I also tried passing the root 

svggen.stream(root, svgOutput, true);

 I also tried setting the use css param to false.


The debugger does show that the first child is a SVGStyleSheetInstruction
but it most be removed at some point.


Any help would be greatly appreciated.






View raw message