Menu

#124 XMLStarlet failed to properly `format` certain SVG image

all
closed-invalid
nobody
None
5
2018-09-01
2018-08-15
No

Refer the attached SVG image for sample, after formatting(--indent-spaces 2) notice that:

  1. At line 3, the metadata, rdf:RDF, cc:Work, dc:format, dc:type, defs, and sodipodi:nameview elements are not separated to individual lines.
  2. At last line (line 8), <g>, <path />, </g>, and </svg> elements are all on the same line.

It appears that the formatting is broken in a degree, which matches the result of http://xmlbeautifier.com/ but not https://codebeautify.org/xmlvalidator, which seems to use a different algorithm.

1 Attachments

Discussion

  • 林博仁(Buo-ren Lin)

    The output of xmllint --format also seems to be broken as well, so it might be a libxml issue.

     
  • 林博仁(Buo-ren Lin)

    People at libxml2 informed me that this is due to the xml:space="preserve" attribute in the SVG file, after removing the attribute xmlstarlet works as expected.

     
  • Noam Postavsky

    Noam Postavsky - 2018-09-01
    • status: open --> closed-invalid
     
  • Noam Postavsky

    Noam Postavsky - 2018-09-01

    Okay, sounds like it's working as intended, closing the bug.

     

Log in to post a comment.

Auth0 Logo