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.

Is there a reason SvgDocument.Open(XmlReader) is not exposed?

See original GitHub issue

SvgDocument.Open only accepts a string, Stream or XmlDocument, but there is no public overload for reading out of a generic XML, which should be done via XmlReader. It seems the overload is there, but it is not public. Is there a reason for it, or could it be exposed?

This would make reading SVG files from other sources much easier. The data could be produced from a text stream or from a possible serialization of the XML infoset other than the standard one, from XDocument, XElement (and XmlElement as well) or XPathNavigator, all without having to store the whole document in memory at once. Additionally a custom entity resolver could be used as well.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
H1Gdevcommented, Sep 21, 2021

I created PR #897.

  • Wrap XmlReader for supporting XXE Mitigation.
  • Open with entities cannot be provided.
1reaction
mrbean-bremencommented, Sep 18, 2021

Yes, but the issue is about this method:

private static T Open<T>(XmlReader reader) where T : SvgDocument, new()
Read more comments on GitHub >

github_iconTop Results From Across the Web

Class SvgDocument | SVG.NET API
Renders the SvgDocument in given size and returns the image as a . If one of rasterWidth and rasterHeight is zero, the image...
Read more >
Why is this xmlreader code not working?
The reason why it is not working for you is because you only read to the start-tag of the d:Title element and that...
Read more >
A Roadmap to XML Parsers in Python
In this tutorial, you'll learn what XML parsers are available in Python and how to pick the right parsing model for your specific...
Read more >
XML - Managing Data Exchange/Print version
This is the print version of XML - Managing Data Exchange You won't see this message or any elements not part of the...
Read more >
Why does my app send network requests when I open an ...
Let's think that the first method receives the picture over the network, and the second one sends it back. What is hidden behind...
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