| Welcome to YAML | |||||||||||||||||||||||||||||||||||||||
|
YAML is a minimal markup language based on XML and Minimal XML. YAML is based upon the following principles:
As such, YAML is defined as a labeled tree structure. It differs from XML in many ways:
|
|||||||||||||||||||||||||||||||||||||||
| Data Typing | |||||||||||||||||||||||||||||||||||||||
|
Tag names consist of two parts, a label and a data type. These parts are seperated by a colon. The supported data types are:
For convienence, the following "derived" types are emitted. They are not Standard ML types, but may be useful nonetheless.
|
|||||||||||||||||||||||||||||||||||||||
| Tag names | |||||||||||||||||||||||||||||||||||||||
|
In general, Tag names follow the requirements of XML tag names, although tags with periods have special meaning, and tags beginning with an underscore are reserved. In particular, tags with one or more periods must use a DNS based structure where the right-most parts are a top level domain, like "com", "org", "co.uk". Then, immediately preceding the top level domain, is the registerd part, like "clarkevans". And preceding the registered part, is up to the user. Therefore: "timesheet.clarkevans.com", and "zoom.mytag.domain.co.uk" would both be valid names according to this scheme. Also note, that the data type can be appended to the end of any of these data types using the :, as described above. Thus, "timesheet.clarevans.com:list" would be a globally qualified list. |
|||||||||||||||||||||||||||||||||||||||
| Information Model | |||||||||||||||||||||||||||||||||||||||
|
Theinformation model for YAML is as follows (borrowing heavily from Minimal XML).
Also, the Node may have the following computed information.
|
|||||||||||||||||||||||||||||||||||||||
| Example | |||||||||||||||||||||||||||||||||||||||
<timesheet.clarkevans.com:record>
<person:record>
<id:int>
293945</id:int>
<name:record>
<given>
Clark</given>
<family>
Evans</family></name:record></person:record>
<journal:list>
<journal:record>
<date:record>
<day:int>
12</day:int>
<month:int>
1</month:int>
<year:int>
2001</year:int></date:record>
<description>
On this day, I worked on three topics,
soon to folow.</description>
<entry:list>
<entry:record>
<duration:int>
120</duration:int>
<project>
Self-Study, ML</project>
<description>
Finished Chapter 3 of book.</description>
<reference:list>
<reference>
Elements of ML Programming, by Jeffery
D. Ullman, ML97 Edition</reference>
</reference:list></entry:record>
<entry:record>
<duration:int>
90</duration:int>
<project>
Double Gemini</project>
<description>
Worked on software development schedule, final delivery
date end of March.</description></entry:record>
</entry:list></journal:record></journal:list>
</timesheet.clarkevans.com:record>
|
|||||||||||||||||||||||||||||||||||||||
| Some thoughts | |||||||||||||||||||||||||||||||||||||||
|