3 ms·
If you have XML namespaces, you can embed foreign XML types in your XML (like the grandparent's SVG example) and also keep your schema-validating XML generators
by ketralnis 11y ago
If you have XML namespaces, you can embed foreign XML types in your XML (like the grandparent's SVG example) and also keep your schema-validating XML generators/parsers. That's good for the same reason static type checking is good.
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 v2
Part of that problem is solved with schema versioning and part of it is solved with namespaces.
- mozumder 11y agoYou can do all sorts of stuff if you make it more complicated. Doing more isn't a good thing.