Serialize the loaded SVG back to a string
Karandra opened this issue · comments
Is there a way to save the loaded SVG document to an xml string? There was a function SVGDocument::toString in the older versions, in 1.4.x at least. Now there isn't one. I'm thinking maybe it's possible to reconstruct the file traversing the document through its root element, but I'd rather use something that's already there, if possible.
SVGDocument::toString is not coming back for the sake of simplicity, and currently, reconstructing the document by traversing it through the root element isn't possible either.
That is not fun. Guess I'll have to find a different SVG library, because I need this feature. Or I can stick to v1.4.
This is unfortunate. If you find another library with this feature, go for it. v1.4.x is quite old, so I wouldn't recommend sticking with it. Also, I did a bit of digging and noticed you're using SVGDocument::toString to clone or duplicate the document. I actually have an internal function that essentially does that. I never thought anyone else would need it!
Is that function available in 1.4 and is public?
No, that function isn't available in 1.4.x. Also, v1.4.x is quite old, so I wouldn’t recommend sticking with it.