Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
7cc5aff4
Commit
7cc5aff4
authored
Nov 12, 2013
by
Tebjan Halm
Browse files
added check for namespace attribute on parse, fixes #30
parent
fe8d87f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/SvgElementFactory.cs
View file @
7cc5aff4
...
@@ -180,8 +180,27 @@ namespace Svg
...
@@ -180,8 +180,27 @@ namespace Svg
}
}
else
else
{
{
//attribute is not a svg attribute, store it in custom attributes
//check for namespace declaration in svg element
element
.
CustomAttributes
[
attributeName
]
=
attributeValue
;
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
;
}
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment