SVG:Namespace: Difference between revisions

Jump to navigation Jump to search
→‎declare namespaces for svg and xlink: mention SVG doctype as well
(→‎declare namespaces for svg and xlink: mention SVG doctype as well)
Line 1: Line 1:
= declare namespaces for svg and xlink=
= Declare namespaces for SVG and XLink=


the namespace declaration for svg is required if you don't specify it, nothing will be rendered. the xlink namespace is required if you use <use/>, <image/>, <a/> ...
the namespace declaration for svg is required if you don't specify it, nothing will be rendered. the xlink namespace is required if you use <use/>, <image/>, <a/> ...
Line 14: Line 14:
   
   
  </svg>
  </svg>
== Declare DOCTYPE for SVG ==
Similarly, declaring a correct DOCTYPE for .svg files is important as well, instances have been observed where an SVG file without namespace and incorrect doctype did work in Adobe SVG, but with the namespace added it didn’t work, until the DOCTYPE was corrected as well. The doctype is supposed to be:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
This should solve the cases where the addition of the namespaces required by Mozilla breaks rendering with Adobe SVG.
= use namespace-aware methods in javascript=
= use namespace-aware methods in javascript=


19

edits

Navigation menu