rebootcode / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

Generated SVG Script Does Not Include <?xml version #944

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
According to the W3C Recommendation SVG 1.1 (Second Edition) on 16 August 2011 
at < http://www.w3.org/TR/SVG/struct.html > and other resources, an SVG 
document starts with "<?xml version=..." before the <SVG...> element.

All modern SVG editors, like Illustrator, Inkscape, etc., generate SVG with the 
"<?xml version=" information. Many of these same SVG editors get "confused" 
without the xml information, so it would be beneficial to have SVG-Edit output 
SVG as defined by the SVG 1.1 (or newer) Recommendation.

What steps will reproduce the problem?
1. Launch SVG-Edit
2. Draw a picture
3. Click on Edit Source
4. Look at generated SVG script.

Expected result: SVG is generated with "<?xml version..."

Output: SVG is generated without "<?xml version..."

In what browser did you experience this problem? (ALL, Firefox, Opera, etc) ALL

In what version of SVG-edit does the problem occur? (Latest trunk, 2.5.1,
etc) ALL

Please provide any additional information below.

SVG with "<?xml version..." information that is inserted into SVG-Edit will 
have the "<?xml version..." information removed. For example:

--- The Input SVG ---

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   id="svg2"
   version="1.1"
   inkscape:version="0.47 r22583"
   width="230"
   height="210"
   sodipodi:docname="simple_red_square.svg">
  <metadata
     id="metadata9">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>

  </metadata>
  <defs
     id="defs7">
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="0 : 0.5 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_z="1 : 0.5 : 1"
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
       id="perspective11" />
  </defs>
  <sodipodi:namedview
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1"
     objecttolerance="10"
     gridtolerance="10"
     guidetolerance="10"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:window-width="640"
     inkscape:window-height="483"
     id="namedview5"
     showgrid="false"
     showborder="false"
     inkscape:showpageshadow="false"
     inkscape:zoom="0.22425739"
     inkscape:cx="367.04724"
     inkscape:cy="-311.18109"
     inkscape:window-x="0"
     inkscape:window-y="0"
     inkscape:window-maximized="0"
     inkscape:current-layer="svg2" />
  <rect
     style="fill:none;stroke:#ff0000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
     id="rectangle"
     width="220"
     height="200"
     x="5"
     y="5" />
</svg>

--- Becomes this Output SVG ---

<svg width="230" height="210" xmlns="http://www.w3.org/2000/svg">
 <metadata id="metadata9">image/svg+xml</metadata>
 <g>
  <title>Layer 1</title>
  <rect fill="none" stroke="#ff0000" stroke-width="10" stroke-miterlimit="4" y="5" x="5" height="200" width="220" id="rectangle"/>
 </g>
</svg>

Original issue reported on code.google.com by vander...@rocketmail.com on 9 Apr 2012 at 6:56

GoogleCodeExporter commented 8 years ago

Original comment by asyazwan on 10 Apr 2012 at 2:18

GoogleCodeExporter commented 8 years ago

Original comment by bret...@gmail.com on 7 Apr 2014 at 3:38

GoogleCodeExporter commented 8 years ago

Original comment by bret...@gmail.com on 7 Apr 2014 at 3:45