
Creating Layouts for XMLNuke Creating Layouts with XMLNuke
CHow to create visual layouts for documents produced with XMLNuke.
Table of contents 1. Creating Layouts with XMLNuke 2. Creating Structural Snippets 3. Creating Template Snippets
On this page Introduction Creating an XSLT document
Introduction
Because XMLNuke generates only XML documents, these documents must be transformed so that the user can understand them. This transformation process will generate a resulting document like XHTML or any other type of document.
The document that transforms an XML into another is the XSLT (eXtensible Style Sheet Transformation). This document contains commands to iterate the XML elements, extract information, and apply a certain formatting or transformation to it.
When using XMLNuke, the creation process for XSLT documents is made much easier than the implementation of ?snippets? codes. This technique allows us to concentrate ONLY on what we really want to do.
For this, XMLNuke assumes that a standard page has the following layout:
Composed of:
- The design of this page
- Blocks of code (to the left, centralized, to the right)
- Menu
The Design of the page corresponds to the visual organization of the page and how the blocks will be layed out. Obviously, the blocks do not necessarily need to be layed out according to the layout of the figure above, but it is there to give an example of how to organize ourselves. If you have advanced knowledge of XML and XSLT, you can create your own layout and document structure. The following topics will deal with how to create an XSLT document.
Creating an XSLT document
The basic document structure that can be used by any page or even a file format is the following:
Note that items 1 and 3 will always be the same. The personalization of your HTML layout must be done in space number 2. It's important to note that this layout may be developed by any visual editing tool or not, such as Dreamweaver, Homesite, etc. The only restriction is that all of the tags must be closed, even the ones that wouldn't in HTML. For example:
Document Formatting
Open tags that do not close in HTML must "close" in XML/XSLT:
<br> change to <br />
<img src=""> change to <img src="" />
<input ...> change to <input .... />
<hr> change to <hr />
Note too that in space 2 and space 3 there are some references:
References to Snippets
<xmlnuke-menucss/>
<xmlnuke-blockcentercss />
<xmlnuke-blockleftcss />
<xmlnuke-blockrightcss />
<xmlnuke-htmlbody />
...and so on. These tags started by XMLNuke make references to the snippets that have the names: snippet_menucss.inc, snippet_blockcentercss, etc.
Note: The htmlbody Snippet requires that the htmlheader snippet be used within the HTML.
These snippets may be located in two folders:
- data/shared/snippet
- data/sites/YOURSITE/snippet
The location that is within your site always has priority and overwrites any definition in "data/shared". Because of this, it is advisable to copy the snippets that will be modified to the folder on your site.
Another important piece of information: The Snippets created within space number 2 (in the previous figure) are called Structural Snippets and the snippets created in space number 3 are called Snippets of Xml Objects ou Template Snippets
|