Closed spyderweb56 closed 6 years ago
Hello. I've successfully installed and run package as written in readme.md. I pick .svg file, set destination folder, click start.
And I see this: `java -classpath lib/mxgraph-core.jar:classes com.mxgraph.svg2xml.Svg2XmlGui
parsing add using 0 configs
parsing arrow_dwn using 0 configs
parsing flagbe using 0 configs
parsing key_1 using 0 configs
[Fatal Error] :4:28: The markup in the document preceding the root element must be well-formed.
org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 28; The markup in the document preceding the root element must be well-formed.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at com.mxgraph.svg2xml.Svg2Xml.parseXml(Svg2Xml.java:1941)
at com.mxgraph.svg2xml.Svg2Xml.
I've tried to run with sudo and different combinations of checkboxes(marked as TODO) - nothing changed. Every time I see console output and no xml.
I attach some svg's, it may help to reproduce the problem. svg.zip
Ubuntu 16.04 x64. java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
Is there any other info I can provide to help you resolve this?
And what is the markup in the document preceding the root element? If there is an XML declaration, did you try removing that?
I've removed markup preceding svg tag and there is no more error. No xml file either. Just line 'parsing key_1 using 0 configs'.
I have another file `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1300px" height="830px" viewBox="0 0 1300 830">
<circle id="e3_circle" cx="715" cy="388" style="fill:darkcyan;stroke:black;stroke-width:1px;" r="84.6494"/>
<g id="e7_group" style="fill:red;stroke:red;" transform="matrix(1 0 0 1 -101 84)">
<path d="M862,354a86.583806,86.583806,0,0,1,97,1" style="fill:red;stroke:black;stroke-width:1px;"
id="e4_circleArc" transform="matrix(1 0 0 1 -94 -121)"/>
<polyline style="stroke:black;fill:red;stroke-width:1px;" id="e5_polyline" points="863 354 909 427 958 354"
transform="matrix(1 0 0 1 -94 -121)"/>
</g>
, which contains polyline element and gives next response:
parsing logo using 0 configs
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at com.mxgraph.svg2xml.Shape2Xml.matrixTransformPoly(Shape2Xml.java:771)
at com.mxgraph.svg2xml.Shape2Xml.parse(Shape2Xml.java:131)
at com.mxgraph.svg2xml.Svg2Xml.
After I remove polyline, same story - no errors, no xml.
If there is no error, there should be an XML, maybe you're looking at a wrong place. It should be probably in some sub-folders based on source location. Check for all *.xml files in subfolders of your destination folder.
Looks like I found the problem. There is an XML, but not where it supposed to be. When I pick folder /home/astulov/Downloads/svg as a destination program creates file at /home/astulov/downloads/svg/picsome/astulov/downloads/svg.xml. When I switch it to /home/astulov/ I get another path: /home/astulov/downloads/svgome/astulov/downloads/svg.xml When I set /home/astulov/Documents/ - /home/astulov/documentsome/astulov/downloads/svg.xml.
It is working as intended. Check the readme, it describes the logic behind destination selection. Svg2xml is meant to be a mass conversion tool, so the entire source folder structure will be recreated at the destination. If you convert only one file, or one folder, this might be confusing.
Yes, it seems a little bit confusing to me. It is intended to create totally different path by lowercasing my Downloads folder. And generate random path every time I change destination folder. And create .xml files anywhere, except the folder I pick with your interface. Is that what supposed to be done when I click start?
Strange path behavior stay when I pick whole folder for processing.
The path isn't random, just not intuitive at start. Let's say, create a folder called "stencils" on d:\ Now add some subfolders to the "stencils" folder. Add 4-5 SVG files to each subfolder and as source mark the "stencils" folder. By examining the generated files it might be clearer why things aren't random.
Terminal sits at "parsing Blog using 0 configs" even though I have some things checked.