This plugin allows the definition of several documents into one XML file.

Usage:

$ stog --package stog.multi-doc ...

Suppose we have the following XML document in the file smallposts.html at the root of a Stog directory:

The first post ... The second post ... This is the body of the document "/smallpost". We can list our small posts here: ]]>

The muti node at the root of the document indicates that several documents are defined. The whole document is first read as any other document: it can have attributes specified for the multi node, and the body is the contents under this node.

The multi-doc plugin adds a level -10 to cut the documents of type "multi". To do so, each root node of the body is read as if it was in its own file. Here we declare two documents of type "smallpost", with titles, dates and bodies. The contents node contains the body of the document "/smallposts". The two other documents are named "/smallposts/post1" and "/smallposts/post2", from the path of the document and their respective ids, using a default separator "/". The contents node must have a type attribute.

All documents share the definitions appearing in the original "multi" document, here sets="smallposts".

The paths of the created documents are forged from the path of the "multi" document, the id attribute of each "sub" document and a separator. The default separator is "/" but it can specified with the path-sep attribute:

... ... ... ]]>

With the code above, the two "smallpost" documents will have paths "/smallposts-post1" and "/smallposts-post2". They can be refered to for example with doc rule:

]]>

As any other document, one can use the with-contents="true" attribute to indicate that the body of the document is included in a contents node. Here is an example using with-contents="true" for the multi document, for the rest of the definition of this documents and for one of the "smallpost" documents:

The result is visible here.