On Wednesday, May 11, 2005, at 12:11 PM, Paul Hoffman wrote:
<entry fooBar="true">
   <title>...</title>
   <evilExtension />
   ...
</entry>

Legal? Which part of the spec rules it out? Maybe I've read it too
many times and I'm missing something. Common sense would seem to
outlaw it, but that's not good enough.

Hearing from as many people who feel that they understand the "XML rules" would be very good right about now...


I'm no expert on the actual rules, but here's my take:

* HTML has no concept of namespaces, so when people invent a new tag, they don't give it a unique prefix. XML has namespaces, so when inventing new elements, common sense and past experience suggest putting them in a namespace under the control of the inventor.

* Atom is being defined by an RFC, in which the namespace is also specified. Common sense suggests that without updating or obsoleting that RFC, new elements can't be added to that namespace unless the RFC itself defines a method for that being done.

* Common sense suggests that allowing third parties to insert elements into someone else's namespace makes little more sense than allowing third parties to change the definition of elements in someone else's namespace, which would clearly be ridiculous.

* If somebody publishes the above, who's going to do anything with evilExtension? Nobody's going to know what it is, so it won't be processed, and won't do anything evil. If it is evil, it won't get popular enough to be supported. Even if it's not evil, I can't imagine it getting popular without a lot of people screaming about how it needs its own namespace, and thus it getting its own namespace.

* I presume the feed validator would choke on the above, right?

Question--do RFCs for any other XML formats explicitly state that something like the above is illegal? If not, then I can't imagine we need to worry about it.

I'd think that if it needs to be stated explicitly that the above it illegal, unless putting things into others' namespaces was specifically intended to be allowed, the appropriate place for it would be in the namespace spec--not the specs for every XML format that uses namespaces.



Reply via email to