W3C home > Mailing lists > Public > www-svg@w3.org > March 2011

Fwd: problem creating ENTITY TAG in DOCTYPE using batik

From: Goldi <goldi.ahuja@gmail.com>
Date: Sun, 20 Mar 2011 10:31:01 +0530
Message-ID: <AANLkTikWnXF9+UOT1th22+ud1gDDpWR3DaMAfi0Wd2wP@mail.gmail.com>
To: www-svg@w3.org
Hello

I am trying to create svg files using batik API.
The Doctype generated does not permits ENTITY TAG
Can somebody guide how to add ENTITY tags in the svg file using batik svg
generator
My code is
            DOMImplementation domImpl =
GenericDOMImplementation.getDOMImplementation();
            String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
            Document document = domImpl.createDocument(svgNS, "svg", null);

            SVGGeneratorContext ctx =
SVGGeneratorContext.createDefault(document);
            SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx,false);

The output so generated gives me

<?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 xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1;
color-rendering:auto; color-interpolation:auto; stroke:black;
text-rendering:auto; stroke-linecap:square; stroke-miterlimit:10;
stroke-opacity:1; shape-rendering:auto; fill:black; stroke-dasharray:none;
font-weight:normal; stroke-width:1; font-family:&apos;Dialog&apos;;
font-style:normal; stroke-linejoin:miter; font-size:12; stroke-dashoffset:0;
image-rendering:auto;" xmlns="http://www.w3.org/2000/svg"
><!--Generated by the Batik Graphics2D SVG Generator--><defs
id="genericDefs"
  /><g
/></svg
>

How do i append ENTITY in the DOCTYPE internalsubset?

I want my DOCTYPE tag to look like

<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
          'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd' [
 <!ENTITY background "fill: #FFFFFF;stroke:#4D4D4D;stroke-width:1;">
]>
Pl guide if anybody has done it in the past.
Thanks
Goldi Ahuja
Received on Monday, 21 March 2011 08:30:22 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:47 GMT