Community,
I am having an issue with Inkscape rendering SVG image differently based on the way the SVG is written out. I start with a simple base case where text is positioned within the drawing and save the file via Inkscape using Inkscape's default file type. I then use PoswerShell to parse the SVG file via XML parser and re-save the SVG file. I did not add, delete, or modify the contents of the file. The only thing that did change was how the elements are pretty printed to the file. The same XML components are there and in the same order. But instead of having a separate line for say each attribute, the attributes would all be on the same line.
When Inkscape's reloads the SVG file, I see the alignment of the objects are off. Because the image is saved as an XML document, I would not expect the rendered out come different soley based on line returns in the file between attributes and elements. I wanted to report this to the community at large and see if there is a better workaround than what I found.
Below is the simple PowerShell script that opens and saves the SVG file to test with.
$path = "C:\Calendar\test.svg"; $xml = [XML](Get-Content $path); $ns = @{dns="http://www.w3.org/2000/svg%22%7D; $xml.Save($path);
I do not believe at this time the issue is with PowerShell, but merely the layout of the XML results in different behavior, though the content is still the same.
My workaround consists of saving the SVG image not as default format, but as plain SVG format. While this works, I then forfeit many advantages of using Inkscape, mainly layers in my case.
Thank you for your time.
On Tue, Dec 16, 2014 at 08:24:27AM -0600, Christopher Carver wrote:
Community,
I am having an issue with Inkscape rendering SVG image differently based on the way the SVG is written out. I start with a simple base case where text is positioned within the drawing and save the file via Inkscape using Inkscape's default file type. I then use PoswerShell to parse the SVG file via XML parser and re-save the SVG file. I did not add, delete, or modify the contents of the file.
Inkscape needs structural information that is not accounted for by the SVG spec. It stores that in comments within the XML.
The only thing that did change was how the elements are pretty printed to the file. The same XML components are there and in the same order. But instead of having a separate line for say each attribute, the attributes would all be on the same line.
Is it possible that PowerShell is not preserving those comments?
-- hendrik
could you attach here the original svg file, plus the svg file obtained after processing with PowerShell? If the file attach procedure is not working here, perhaps you could submit a bug report at: https://bugs.launchpad.net/inkscape/.
thanks, Alvin Penner
-- View this message in context: http://inkscape.13.x6.nabble.com/SVG-XML-re-write-malformation-tp4972390p497... Sent from the Inkscape - User mailing list archive at Nabble.com.
participants (3)
-
alvinpenner
-
Christopher Carver
-
Hendrik Boom