Light XML
New statements to implement XML in Scriptol:
- XML ... /XML ... an XML
document .
- tag ... /tag ... an element.
- xul
... modifier that denotes a XUL document.
- include
... including a XUL document.
- script ... /script ... Scriptol code.
XML
The syntax is:
XML nom
... the name is optional.
[xul]
... optional XUL modifier.
[headers] ...
optional header.
[doctype]
... optional doctype.
[include] ...
optional include statements.
element*
... elements.
/XML ...
end of XML code.
When a name is given, the .xml or .xul extension is added to this name to
build a filename for saving the XML document. Otherwise the filename is the
name of the source with an xml or xul extension.
Include
Command to include another XUL document.
The include keyword is followed by one attribute at least, in the form:
href = "path-of-xul-document"
Header
The syntax of headers is:
<? identifier and attributes ?>
Doctype
The syntax of a doctype is:
<! identifier and attributes >
Note that the ending marker is > and not !>
Element
A tag has the simplified XML form:
tagname [attribute [[,] attribute]* ]
[tagname2] | content
...
/tagname
The meaning is:
- tagname, followed by none or one or more attributes, separated or not by
a comma.
- none, one or more elements.
- or a content.
- In Scriptol, when the list of attributes can't fit on a line, a comma is
added at end of line.
- After the "/" symbol, the name of the tag is optional.
Content
A tag can hold other tags or a text
In Scriptol the text is enclosed in quotes.
A multi-lines text is enclosed in ~~.
Attribute
An attribute has the form.
name = "text"
Example | window box size="200" button name="b" width="100" "hello" /button /box /window |