Hi Thomas,

Thank you for your answer. You were right, it was a bug in my code. What I
am trying to do for now is to add a rectangle given as SVG code to a SVG
image. But now I am getting an illegal character error (I tried with
different SVG samples that come with Batik1.6; those should be - and
probably are - valid SVG files...). Please take a look at my code and at the
stack trace below; I do not know what I am doing wrong.
code:
            MyJSVGCanvas mycanvas = new MyJSVGCanvas();
            String xml = "<rect x=\"1\" y=\"1\" width=\"50\" height=\"50\"
fill=\"none\" stroke=\"green\" />";

            Interpreter in = mycanvas.getInterpreter("text/ecmascript");
            SVGDocument doc = (SVGDocument)
mycanvas.getBridgeContext().getDocument();
            logger.error("!! doc: " + doc.getURL());
            Node n = (Node) in.evaluate("parseXML('" + xml + "'," + doc +
")");

            doc.getDocumentElement().appendChild(n);
        
.....................................................................

error:
ERROR 11 Oct 2006 11:28:45,921 ImagesManager - !! doc:
file:/E:/Batik/batik-1.6/samples/batikCandy.svg

ERROR 11 Oct 2006 11:28:45,953 ImagesManager - 
SyntaxError: illegal character (<SVG>; line 1)
        at
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:597)
        at
org.mozilla.javascript.TokenStream.reportSyntaxError(TokenStream.java:1324)
        at org.mozilla.javascript.TokenStream.getToken(TokenStream.java:1302)
        at org.mozilla.javascript.Parser.memberExprTail(Parser.java:1213)

-- 
View this message in context: 
http://www.nabble.com/generate-a-svg-file-from-more-svg-files-tf2410706.html#a6752809
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to