Commit 7cc5aff4 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

added check for namespace attribute on parse, fixes #30

parent fe8d87f3
......@@ -179,11 +179,30 @@ namespace Svg
}
}
else
{
//check for namespace declaration in svg element
if (string.Equals(element.ElementName, "svg", StringComparison.OrdinalIgnoreCase))
{
if (string.Equals(attributeName, "xmlns", StringComparison.OrdinalIgnoreCase)
|| string.Equals(attributeName, "xlink", StringComparison.OrdinalIgnoreCase)
|| string.Equals(attributeName, "xmlns:xlink", StringComparison.OrdinalIgnoreCase)
|| string.Equals(attributeName, "version", StringComparison.OrdinalIgnoreCase))
{
//nothing to do
}
else
{
//attribute is not a svg attribute, store it in custom attributes
element.CustomAttributes[attributeName] = attributeValue;
}
}
else
{
//attribute is not a svg attribute, store it in custom attributes
element.CustomAttributes[attributeName] = attributeValue;
}
}
}
/// <summary>
/// Contains information about a type inheriting from <see cref="SvgElement"/>.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment