Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does svg xmlns attribute value requires protocol? Can it be https or relative?

Tags:

html

svg

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

Can xmlns="http://www.w3.org/2000/svg" this be xmlns="https://www.w3.org/2000/svg"?

or xmlns="//www.w3.org/2000/svg"?

like image 575
user1783209 Avatar asked Oct 10 '16 13:10

user1783209


People also ask

Can an xmlns be https?

1 Answer. Show activity on this post. omitting the http or changing it to https will not work. The fact that the namespace contains http does not mean in any way that the SVG file will use the http protocol for any kind of communication.

Is Xmlns required for SVG?

Note: The xmlns attribute is only required on the outermost svg element of SVG documents. It is unnecessary for inner svg elements or inside HTML documents.

What is SVG xmlns http www w3 org 2000 SVG?

SVG namespace. http://www.w3.org/2000/svg is an XML namespace, first defined in the Scalable Vector Graphics (SVG) 1.0 Specification and subsequently added to by SVG 1.1, SVG 1.2 and SVG 2. The SVG namespace is mutable; names may be added over time by the W3C SVG Working Group by publication in W3C Technical Reports.

What is the purpose of xmlns attribute?

The xmlns attribute specifies the xml namespace for a document. Note: The xmlns attribute is required in XHTML, invalid in HTML 4.01, and optional in HTML5. Note: The HTML validator at http://w3.org does not complain when the xmlns attribute is missing in an XHTML document.


1 Answers

It's not really a URL, it's a namespace that simply happens to look like a URL. As such it must be written exactly as

xmlns="http://www.w3.org/2000/svg"

omitting the http or changing it to https will not work.

The fact that the namespace contains http does not mean in any way that the SVG file will use the http protocol for any kind of communication. The w3c could have defined the SVG namespace as foo in which case we'd all be writing xmlns="foo" and you'd not even be asking such questions.

like image 190
Robert Longson Avatar answered Oct 08 '22 17:10

Robert Longson