Document (globalcampus.site/namespace.stxt): Chapter 5: Documents With Namespace Default: Title: STXT: The Book Navigation: Previous: Previous (04-raw-docs) Next: Next (06-examples) Assert: Everything explained for documents without a namespace applies, except for multiline nodes. Content: As a summary of the previous: * UTF-8 Encoding Always * Identifiers are CASE-INSENSITIVE * There are no escape characters * In @STxT@, all lines that start with the character # are comments * 4 spaces are equivalent to one tab Assert: The use of `:` for multiline nodes is not allowed.\ This is implicit due to the node type. Content: If the `:` character is inserted, it will simply become part of the text, not considered special. The other text types do not allow multiple lines, so it will have no effect. Header: Namespace Definition Content: A namespace is a document without a namespace with the first node called `Namespace`, which is a structure with all the possible node types, as an example. Assert: A node is defined only once, and it cannot be redefined afterward.\ It is allowed to appear earlier as long as the structure is not defined. Content: Let's look at an example: Code: Namespace: www.demo.com/document.stxt Document: Title: (1) ***Sections: (?)*** Description: (1) TEXT Document Type: (1) ENUM :report :article :essay ***Sections:*** ***Section: (+) TEXT*** Content: A simpler way to define it would have been: Code: Namespace: www.demo.com/document.stxt Document: Title: (1) ***Sections: (?)*** ***Section: (+) TEXT*** Description: (1) TEXT Document Type: (1) ENUM :report :article :essay Content: Finally, a document from the namespace: Code: Document (www.demo.com/document.stxt): Title: First simple document Description: This is the first simple document. It has multiple lines Document Type: report Sections: Section: This is a section Section: This is a section with more than one line. Subheader: Quantity Definition Content: It is allowed to define the quantity of nodes as follows: * `?`: May or may not appear (maximum 1) * `+`: At least one node * `*`: Any number of nodes * `num+`: _num_ or more nodes * `num-`: _num_ or fewer nodes * `num`: exactly _num_ nodes Subheader: Node Types Content: The following node types are allowed: * `STRING` (Default value) * `TEXT` (allows multiline, does not allow child nodes) * `NUMBER`: /^(\-|\+)?\d+(\.\d+(e(\-|\+)?\d+)?/ * `BOOLEAN`: true | false * `REGEX`: valid regex * `ENUM`: Valid values are shown in the following multilines * `DATE`: YYYY-MM-DD * `TIMESTAMP`: ISO_8601 * `EMAIL`: valid email * `URL`: valid url * `HEXADECIMAL` (allows multiline, does not allow child nodes) * `BASE64` (allows multiline, does not allow child nodes) * `EMPTY`: does not allow content * `INTEGER`: (+|-)?\d+ * `NATURAL`: \d+