If you need to add namespaces, then you have already failed.
If you need to add namespaces, then you have already failed.
It can also simplify the code that parses it. With an SVG XML document embedded right in your TV XML document, you can e.g. use your functions that take an SVG node regardless of whether it was the root node of a document or embedded in another document and render it to the screen.
It can also let you do versioning. For instance, let's give a schema like
<render>
<image src="..." />
</render>
Then in version 2 you support multiple screens, so now you want <render>
<screen number="1">
<image src="..." />
</screen>
<screen number="2">
<image src="..." />
</screen>
</render>
Example #2 should be an error in schema v1, and example #1 should be an error in schema v2Part of that problem is solved with schema versioning and part of it is solved with namespaces.
Doing more isn't a good thing.
xmlns="http://apple.com/TVML/1.0"
(or similar) to the top-level tag.And absolutely nothing else has to change.
For that matter, even ignoring the issues of being able to embed foreign content later, just sheer versioning is a good enough reason to add that. And once you agree versioning is a good idea, why not do it via namespace? It's not like
version="1.0"
is materially different or shorter.If you're expressing a certain crabbiness about this being in XML in the first place, you'd have to take that up with Apple. But once you're using XML, you ought to take advantage of what comes with it.
EDIT: I think someone is probably down-voting me for a technical reason. Would you please explain it?
Apple is really good about giving developers a heads up before deprecating anything.