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

added check for namespace attribute on parse, fixes #30

parent fe8d87f3
......@@ -180,8 +180,27 @@ namespace Svg
}
else
{
//attribute is not a svg attribute, store it in custom attributes
element.CustomAttributes[attributeName] = attributeValue;
//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;
}
}
}
......
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