- All tags begin with tml:
- WebTML tags can be nested - in accordance with XML regulations. Only the use of WebTML tags in the attribute values of other WebTML tags is prohibited (as it is in XML).
- All tag names and attribute names are written in lower case.
- Every tag has a "result". this result is the output of the tag to the document.
- The WebTML is processed from top to bottom. Embedded designs (via: "tml:include") are processed where they are embedded.
- Every tag can have a unique ID. This ID can be given in the id attribute. Otherwise the tag has no ID and can not be refered to from other tags. Avoid double IDs on the website. Tags can only be refered to after they have been processed.
The tag context
The tag context is a basic concept of WebTML. Every WebTML tag will be proceeded in the context of a XML content document. This means that always the content document in current context is used when a WebTML tag requests any information from a content document, f.e. via tml:item or via tml:metadata. For any browser request the content document requested in the URL is the one in context. When requesting "http:/.../home_index.html“ the general tag context for all tags is thus the content document "index" in the area "home". This context is also called "main context".
This context can change when WebTML is processed. On the one hand there is the tag attribute "context" the designer can use to get other content documents in the current context. On the other hand the context is changed automatically in navigators and foreach loops. These two tags select a group of documents and proceed their content in context of any single document once. Thus, in the following example the item "Text" is read from a different content document for any iteration of the navigator tag.
Example:
<tml:navigator type="siblings">
- <tml:item name=“Text“/>
Contexts are inherited from top to bottom within the tag hierachy, i.e. the context of a WebTML tag is parallelly the context of all WebTML tags in its content (a long as those do not change their own contexts themselves). This is fact even when designs are embedded via "tml:include". A tag on the same level on the other hand is not influenced.
The concept of contexts can be made clear in the following design example:
<!-- Start with the context from the URL: index_flightroutes -->
The title:: <tml:meta name=“title“/> <!-- Context on index_flightroutes -->
<tml:range context=“root“>
- <!-- Context on root from index_flightroutes = index -->
<tml:navigator type="children">
- <!--- Repeated in the context of all child documents of index-->
<tml:item name="Text"/>
Author: <tml:meta name=“author“/> <!-- Context back to index_flightroutes -->
Special functionality for tag attributes
Furthermore it is possible to include the content of tag attributes in rolling brackets and thus have a TMLScript procession of the attribute content started. The result of the procession then is the real attribute content, f.e.
<tml:foreach pagesize="{ this.thepagesize }"/>
In this example the attribute "pagesize" is read from the field "ThePageSize". When this field has f.e. the value 10, the upper expression is identical to:
<tml:foreach pagesize="10"/>
Another notation allows the adoption of a result of other tags as attribute content:
<tml:evaluate id="itemname"/>return „Hello User!“;</tml:evaluate>
<tml:foreach pagesize="{tag:itemname}"/>
This example proceeds the above-mentioned TMLScript in a separate evaluate tag and loads the content in a special syntax into the attribute. This strategy is recommended when computings become too complex to be displayed in the limited space of an attribute or when you are" running out of inverted commas".
There is a notation to load the content of an item directly into an attribute - without computing:
<tml:evaluate var="_itemname"/>return „Hello User!“;</tml:evaluate>
<tml:foreach pagesize="{item:_itemname}"/>
The notation"{item:" and "{tag:" are superior to the execution of TMLScript expressions because they are faster as no processing has to take place.