question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to parse XML comment as stream

See original GitHub issue

When a SVG XML file begins with an XML comment, the SVG file is not parsed (stream ends immediately):

<!-- Test -->
<svg height="200" width="500">
  <polyline points="20,20 40,25 60,40 80,120 120,140 200,180" style="fill:none;stroke:black;stroke-width:3" />
</svg>

Without the comment, parsing as stream works fine:

<svg height="200" width="500">
  <polyline points="20,20 40,25 60,40 80,120 120,140 200,180" style="fill:none;stroke:black;stroke-width:3" />
</svg>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
TobiasNickelcommented, Nov 15, 2020

wow, version 4 of txml is published. now it does not directly export the parse function, but an object with a parse function. this is for better compatibility between node and typescript modules.

and here is the PR to svgo: https://github.com/svg/svgo/pull/1301

only one file changed and all its tests passed.

1reaction
TobiasNickelcommented, Oct 1, 2020

hi, just want to say, this matter is not forgotten. Last week I was working on a blog post about Web-Push. Today, I continued a little with debugging the svgo fork. I pass about 15 more plugin tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Error when trying to parse an XML stream - Stack Overflow
I create a url that will trigger our GSA to return an XML reply. I have double checked that the url generation is...
Read more >
Failed to parse XML - Salesforce Stack Exchange
The error here is describing a problem with the XML rather than the code you're using to process it. Please edit your question...
Read more >
Parsing XML while ignoring comments/mixed context/PI
Let's say I have three boolean variables representing whether or not to ignore comments, mixed context and PIs in an XML document
Read more >
XML Parser Error Codes - IBM
If the XML parser detects an error in the XML document during parsing, message RNX0351 will be issued. From the message, you can...
Read more >
QXmlStreamReader Class | Qt Core 6.4.1 - Qt Documentation
Reads the next token and returns its type. With one exception, once an error() is reported by readNext(), further reading of the XML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found