aspose file tools*
The moose likes XML and Related Technologies and the fly likes Populating ENTITY tag using batik Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Populating ENTITY tag using batik" Watch "Populating ENTITY tag using batik" New topic
Author

Populating ENTITY tag using batik

Goldi Ahuja
Greenhorn

Joined: Mar 19, 2011
Posts: 11
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:'Dialog'; 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?
Pl guide if anybody has done it in the past.
Goldi Ahuja
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Why not just treat this as a problem in modifying a text file rather than getting all wound up in XML parsing?

Bill
Goldi Ahuja
Greenhorn

Joined: Mar 19, 2011
Posts: 11
Hi Bill

Greetings.. Yea I can modify the text file but I was wondering if there is a proper xml way to do it
Does this means that XML and Batik do not support creating ENTITY tags?
 
wood burning stoves
 
subject: Populating ENTITY tag using batik