RSS feed question

Do I really need all these xmlns links in my RSS code?

What does the following code mean?

<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
+3
source share
1 answer

Properties xmlnsdefine XML namespaces .

For example, xmlns:atom="http://www.w3.org/2005/Atom"defines a namespace atomas URI http://www.w3.org/2005/Atom .

Then, when you create the element <atom:link>, you can see that it has a URI http://www.w3.org/2005/Atom/link , which the parser will know is the link defined in the Atom specification.

Note. The parser cannot go by namespace name, as you could just as easily use xmlns:a="http://www.w3.org/2005/Atom"what would make an <a:link>Atom link tag.

+6

Source: https://habr.com/ru/post/1756502/


All Articles