Text and xml spaces in the publishing process
This topic may somehow sound esoteric to some readers but this subject is nonetheless important to know about. To make things simple, xml and text spaces could be described as two different ways to process your topics computer files.
In XML space, your topics are represented as a tree of elements with attributes and some content, which might or might not include other elements. The treeview on the left might be a fair example of how your document is seen in xml. An xml element is said to have mixed content when it contains plain text and other xml elements.
XML has the following advantages
- It makes content easier to access;
- It makes content easier to process;
- It makes content easier to reference/reuse;
- It makes content easier to format/publish;
- It makes content more useful.
XML has the following diadvantages
- It can become pretty complex;
- It can be clumbersome for simple tasks;
- It can make some specific tasks more difficult.
In text space, your whole topic file is seen as a string of character that can be accessed by text processing functions found in more traditional programming languages.
Text has the following advantages
- It makes it easier to replace content at the text stream level;
- It makes it easier to include generated content in some places;
- Topics being inherently small, it might be the fastest option for some tasks.
Text has the following diadvantages
- It can induce malformed xhtml in your file; (1)
- It not always the most elegant solution (mostly if you're abit on the purist side).
(1) In the event this is happening, the malformed markup would only affect the "published" xml files, which would abort the transformation process altogether. Don't worry, your source files are always safe.
Processes performed in text space
Small reusable content chunks
Content inserted with the %content_label% method are replaced in text space during the publishing process.
Generated content chunks
Generated content chunks of the Text type are also replaced in text space during the publishing process.
If it finds malformed markup, Tópico will warn you in many cases but to stay on the safe side, just make sure you enter well formed makup in all your personalizations.