xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jane Singer" <jsin...@cc.huji.ac.il>
Subject W3C "valid" SVG documents
Date Mon, 13 Jan 2003 18:41:28 GMT
Hello,

I'm creating an SVG file by importing a basic SVG document (along with a lot
of <def> elements), then appending various graphic, text and use elements,
using the various defs.

I created the file like this:

 File file = new File("F:\\input_output\\basic_document.svg");
    try {
          String uri = file.toURL().toString();
          SVGDocumentFactory df  =
          new SAXSVGDocumentFactory
          ("org.apache.crimson.parser.XMLReaderImpl");

          SVGdoc =  df.createDocument(uri);
        } catch (java.io.IOException ioe) {
        ioe.printStackTrace();
    }

The imported file has a structure like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="600" height="800" viewBox="-10 30 120 80"  >

<defs>
.
.
.
</defs>
</svg>
</xml>

However, when I try to validate the document at the W3C site
(http://validator.w3.org/check), I get an error. The problem is an element
that gets inserted right before the defs element:
<svg contentScriptType="text/ecmascript"
     xmlns:xlink="http://www.w3.org/1999/xlink" width="600"
zoomAndPan="magnify"
     contentStyleType="text/css" viewBox="-10 30 120 80" height="800"
     preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"
     version="1.0">

I'm not sure how this gets inserted. The document validates fine when I
remove it. What is going on?

(I am also getting errors when I try to view it in JSVGCanvas, which is why
I thought to validate it.)

Thanks for any tips.

Jane




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message