1

my svg file content below:

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     width="15cm" height="15cm">
</svg>

what is the width's namespace? is default namespace or "xlink". If you know the answer, could you give w3school reference?

vcsjones
  • 138,677
  • 31
  • 291
  • 286
starcwl
  • 396
  • 2
  • 9

2 Answers2

1

width attribute is neither in default namespace nor xlink namespace. It is, instead, in empty namespace. Attribute need an explicit namespace prefix to be in a namespace (from XML namespace spec, emphesize mine) :

"Default namespace declarations do not apply directly to attribute names; the interpretation of unprefixed attributes is determined by the element on which they appear."

See previous discussion on this topic here : XML Default namespaces for unqualified attribute names?

Community
  • 1
  • 1
har07
  • 88,338
  • 12
  • 84
  • 137
0

The Namespace of width is the same as the one <svg /> is in! While Elements inherit their default-Namespaces from the enclosing elements, attributes are retrieving them from the element they belong to.

w3c Reference