STxT: The Book

A language for the web

Chapter 5: Documents With Namespace

Everything explained for documents without a namespace applies, except for multiline nodes.

As a summary of the previous:

The use of : for multiline nodes is not allowed.
This is implicit due to the node type.

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.

Namespace Definition

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.

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.

Let's look at an example:

Namespace: www.demo.com/document.stxt
    Document:
        Title: (1)
        Sections: (?)
        Description: (1) TEXT
        Document Type: (1) ENUM
            :report
            :article
            :essay
        
    Sections:
        Section: (+) TEXT

A simpler way to define it would have been:

Namespace: www.demo.com/document.stxt
    Document:
        Title: (1)
        Sections: (?)
            Section: (+) TEXT
        Description: (1) TEXT
        Document Type: (1) ENUM
            :report
            :article
            :essay

Finally, a document from the namespace:

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.

Quantity Definition

It is allowed to define the quantity of nodes as follows:

Node Types

The following node types are allowed:

This website uses cookies to ensure you get the best experience on our website. [cookies.html|Learn more] Got it! More info