This Library is currently not managing all objects created in SVG format.
That's why I have met XML level issue while opening a document.
I try to open a document created with Inkscape containing markers.
Markers will look like this:
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
transform="scale(0.8) translate(12.5,0)" />
As explained before, "marker" is unknown element for this Library, but not "path" which is a child element of marker.
Because known elements are stacked/unstacked during document opening, in order to manage elements levels, this will lead to exception when you reach next sibling because your stack count will reach 0 !
In order to solve this issue I had to change code in SvgDocument.Open
My solution is this:
if (element == null)
//Skip non empty unknown element
//This is done to avoid any creation of known children of this element in document
string elementToSkip = reader.LocalName;
while (elementEmpty == false && reader.Read())
if (reader.NodeType == XmlNodeType.EndElement
&& reader.LocalName == elementToSkip)
This simple change will solve the issue.
In addition, you will gain in performance, because unknown children won't be treated by library.