Author:
=======
Anoop Kumar Narayanan
anoop (dot) kn (at) gmail (dot) com
anoop (dot) kn (at) live (dot) in
Purpose:
========
Easily readable
Easily editable
Easily portable
Able to represent hierarchical data
Compatible with XML
Data links to other nodes and attributes
Requires no parser but can have one.
Description
===========
The dot format is intended to be simple to understand, easily readable, portable while able to represent hierarchical data. Unlike JSON and XML formats, the dot format extensively relies on a line based information where each line represents data on a particular level. Each line is separated by a single '\n' and not '\r\n'. Empty lines are dropped and are not considered as data. Each tag starts with a '.' and the first set of lines without a '.' represents some configuration information which has the same format as a DOT line. Comment lines starts with a space. Each tag is followed by attribute value pair. The node specific data is represented with the attribute name '.'. Spaces are used as attribute and node specific value separator. The underscore is used as spaces so the there is no need for any demarcation. '*' or as Asterisk is used as a pointer to node data or an attribute. Multilevel pointers are not supported. In order to represent data of a child, the data in the next line having the tag should has to be preceded with an extra dot.
Escapes:
========
Version 1 of the dot format. The '`' is used as escaping character, the reason being '\' is used as path separator in on windows devices.
The '.' is '.' except when the line starts with it or is immediately followed by a ':'.
Parsing:
========
It can be parsed with simple string operations suchas readline(), string split() and string substitute(). Hence technically there is no need for a library as such.
Parsing Algorithm:
==================
Will be updated soon, please visit this website soon.
Example of XML:
===============
<html>
<head>
<title>
This is a title.
</title>
</head>
<body class="bodyclass">
This is a body.
<h1>
This is a header1 line.
</h1>
This is also a body.
</body>
</html>
Example of DOT representing the above data:
.html
..head
...title .:This_is_a_title.
..body class:bodyclass .:This_is_a_body.
...h1 .:This_is_a_header1_line.
.. .:This_is_also_a_body.
or the explicit representation
.html
..head
...title .:This_is_a_title.
..body class:bodyclass .:This_is_a_body.
...h1 .:This_is_a_header1_line.
..body .:This_is_also_a_body.
or with comments and configuration
version:1.0
author:Anoop
This is a comment
This is also a comment
This is also a comment
.html
..head
...title .:This_is_a_title.
..body class:bodyclass .:This_is_a_body.
...h1 .:This_is_a_header1_line.
This is also a comment
This is also a comment
This is also a comment
..body .:This_is_also_a_body.
=======
Anoop Kumar Narayanan
anoop (dot) kn (at) gmail (dot) com
anoop (dot) kn (at) live (dot) in
Purpose:
========
Easily readable
Easily editable
Easily portable
Able to represent hierarchical data
Compatible with XML
Data links to other nodes and attributes
Requires no parser but can have one.
Description
===========
The dot format is intended to be simple to understand, easily readable, portable while able to represent hierarchical data. Unlike JSON and XML formats, the dot format extensively relies on a line based information where each line represents data on a particular level. Each line is separated by a single '\n' and not '\r\n'. Empty lines are dropped and are not considered as data. Each tag starts with a '.' and the first set of lines without a '.' represents some configuration information which has the same format as a DOT line. Comment lines starts with a space. Each tag is followed by attribute value pair. The node specific data is represented with the attribute name '.'. Spaces are used as attribute and node specific value separator. The underscore is used as spaces so the there is no need for any demarcation. '*' or as Asterisk is used as a pointer to node data or an attribute. Multilevel pointers are not supported. In order to represent data of a child, the data in the next line having the tag should has to be preceded with an extra dot.
Escapes:
========
Version 1 of the dot format. The '`' is used as escaping character, the reason being '\' is used as path separator in on windows devices.
- Asterisk is represented as '`a'.
- Newline is represented as '`n'.
- Low dash is represented as '`l' also called underscore, underline, underbar, low line)
- Period is represented as '`p'
The '.' is '.' except when the line starts with it or is immediately followed by a ':'.
Parsing:
========
It can be parsed with simple string operations suchas readline(), string split() and string substitute(). Hence technically there is no need for a library as such.
Parsing Algorithm:
==================
Will be updated soon, please visit this website soon.
Example of XML:
===============
<html>
<head>
<title>
This is a title.
</title>
</head>
<body class="bodyclass">
This is a body.
<h1>
This is a header1 line.
</h1>
This is also a body.
</body>
</html>
Example of DOT representing the above data:
.html
..head
...title .:This_is_a_title.
..body class:bodyclass .:This_is_a_body.
...h1 .:This_is_a_header1_line.
.. .:This_is_also_a_body.
or the explicit representation
.html
..head
...title .:This_is_a_title.
..body class:bodyclass .:This_is_a_body.
...h1 .:This_is_a_header1_line.
..body .:This_is_also_a_body.
or with comments and configuration
version:1.0
author:Anoop
This is a comment
This is also a comment
This is also a comment
.html
..head
...title .:This_is_a_title.
..body class:bodyclass .:This_is_a_body.
...h1 .:This_is_a_header1_line.
This is also a comment
This is also a comment
This is also a comment
..body .:This_is_also_a_body.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home