Apple TV Markup Language
developer.apple.com
developer.apple.com
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.
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.
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.
What's new in the new tvOS SDK is that you can also write native apps in Objective-C/Swift, with a main() function that starts up UIKit, and with access to most of the normal iOS APIs (like OpenGL, SceneKit, etc etc).
That's only half-sarcastic; it does seem to be a similar but much-simplified markup language that learned a lot from HTML5. Will be interesting to watch it develop.
As others have commented, though, XML without namespaces is not a fun ride (in my humble experience).
[0] https://en.wikipedia.org/wiki/Extensible_Application_Markup_...
Is the future of this ecosystem really exclusively limited to the Television?
Gaming is already an explicit part of this, which undoubtedly will include VR, which is theoretically suited to Television-like content.
If they do this right, the source code running on your VR gogs will mention "TV" everywhere, much like the the current OS running their desktops and mobile devices references a defunct company.
Not television the broadcast medium, but television the giant Samsung device in your living room.
Exactly to my point: It's called iOS because the breadth of it's applicability was recognized from the beginning.
Edit: You're right, and it's different: naming of the mobile OS and namespacing were independent, allowing for a public re-brand without changing any code. Seems the TV is not going that way though.
Gaming is already an explicit part of this"
Presumably people won't be writing games with this simple presentation layer optimized for printing lists of multimedia content - for example TV Shows... Games will (mostly) be written in objC/Swift to the Metal APIs, as will many other apps.
This is just a small portion of the app creation ecosystem for the Apple TV, and since it's geared towards things that traditionally are watched on a TV, I think the name is fine.
--edited to clean up the quote
I am working on a new language concept (still at early thinking) but the alert template document would be defined as:
alert#update_available [ //Composition is separated from definition
btn#update,
btn#cancel
]
alert { //All alert elements are defined as alertTemplate
type: alertTemplate
}
btn { //All btn elements are define as button
type: button
}
alert#update_available { //Define the title and description for the alert with ID update_available
title: Get the latest tvOS version
description: Get the latest tvOS version
}
btn#update {
text: Update Now
}
btn#cancel {
text: Cancel
}
//We could override the settings like CSS
(@language = "pt_br") {
//If variable language is pt_br override the content with Brazilian Portuguese texts
btn#update {
text: Atualize Agora
}
btn#cancel {
text: Cancelar
}
}https://developer.apple.com/library/prerelease/tvos/document...
The (arbitrary) template page linked to has visualizations and code samples. Much better.
In other words, all of the program logic and display elements are on the Apple TV - only the data that's being retrieved and displayed would be stored server-side - which is no different from any iPhone app that displays server based content today.
Is there a reason (legal or otherwise) that they can't just use HTML?
It's significantly more limited and more specific to the task than HTML. HTML comes with a lot of baggage that makes it unsuitable for a really specific use case.
XML does not only look a lot like SGML, it is a proper subset of SGML:
XML is an application profile or restricted form of SGML, the Standard Generalized Markup Language [ISO 8879]. By construction, XML documents are conforming SGML documents.
You know, without namespaces, you take out the eXtensibility-bit.
SGML, actually. "Just markup" can entail other things, like TeX, for example.
I don't know if I agree with the tradeoffs they've made here, but those are at least two reasons to create their own custom schema here.
Rather than expecting developers to use an open-spec-compliant generic toolkit, they've just built modules on top of it to both make development easier and more importantly maintain a consistent UX.
You could just have pre-defined CSS classes and do much of the same thing, but it will not be as elegant nor as controlled. Taking over the HTML and JS interpreters just allows them greater control while respecting the role each component plays (markup, interactivity, styling, etc).
The runtime has JavaScript support, it does not have a brand new interpreter.
The runtime has CSS support, it does not have a brand new interpreter.
The runtime has HTML/XML syntax. Why would they write a brand new interpreter?
Mappping XML to a small subset of UI objects is so simple you don't really need to pull in an entire browser runtime for it.
The BBC have an open source library for building apps for TV based on HTML, CSS and JavaScript called TAL: TV Application Layer. It's designed to be deployed across HTML-based TV devices.
http://fmtvp.github.io/tal/getting-started/introducing-tal.h...
Apple's tvOS is likely to have much richer functionality since it's hosted on Apple's own hardware. However, an open standard for TV apps would be a good thing.
The BBCs TAL was released as open source in March 2013. But I don't know if it's gained wider traction in the industry.
Just imagine all of the garish designs that would pop up.
It's better to restrict what is allowed in a custom markup language so that apple has better control over how it is rendered.
<p>Hello, <strong>dave</strong></p>
Conversely, this is pretty painful to describe in XML:
<pair> <key>name</key> <value type="string">dave</value> </pair>
As for why not HTML? I think there's a lot of really good reasons why HTML would be a poor choice. If you want to restrict Apple TV apps and channels to rely on Apple approved idioms, HTML would be a terrible choice. Apple isn't as interested in creating an open TV browser as much as it's interested in creating a unique and positive TV experience. They can shape that with their own standard.
I really would have liked that XHTML had won.