Hi,

 

This has been mentioned in 2 previous posts:

http://mail-archives.apache.org/eyebrowse/ReadMsg?listId=53&msgNo=2188

http://mail-archives.apache.org/eyebrowse/ReadMsg?listId=53&msgNo=1435

 

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="" ");

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' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>

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

  <defs id="genericDefs" />

  <g>

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

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

     </g>

  </g>

</svg>

 

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.

 

Thanks

 

Daniel

 

Reply via email to