Project | WXT | Basics | Download | Documentation | Samples


[ The script ] [ Processing Instructions ] [ Running WXT ]

WXT is based on two concepts:

Both are explained in detail in Documentation .

The script

The functionality of WXT is based on a script, which is a XML-file. The basic concept is a module. A module is described by a template and any number of sources. The sources may be XML, Database, XHTML, Text, HTML(5). HTML-content that are not well formed and out of the authors control(typically Wiki) may be tidied on the fly. The template must always be a XML or XHTML file.

One of the key-concepts in this kind of module building is addressing. WXT recalculates references in fragments that are moved.

Although the main focus in WXT is on XML-structures, you can also use plain text as content. Typically you can import program code snippets an get them color coded as HTML on your module.

Since the main target of WXT is to share material on the web (or on paper) a lot of the concepts in WXT is (X)HTML oriented. You may however use the basic building mechanisms in WXT to produce any kind of XML, or text for that matter.

One key to this flexibility is the use of XSLT. You may transform content before you bring it to the template and you may transform a module before you save it.

Processing Instructions

The other key concept in WXT is the use of processing instructions. A processing instruction (PI) is legal XML in any XML-file. The program that parses a XML-file will detect the PI's and may act on them. The format of a PI is like this:

<?name data?>

The name and data may have any value. WXT will recognize and react on PI's with name _wxt. The data part is interpreted as a command identifier followed by a series of name, value pairs. Just like attributes in a XML-element. For instance:

<?_wxt importxml location="myfile.xml" xpath="//div[@id='export']"?>

will instruct WXT to extract the div with id="export" from the file myfile.xml and replace the PI with the result. The following:

<?_wxt modulemap books="math"?>

will instruct WXT to produce links to all modules that are marked with book="math" in the script.

Running WXT

You can run WXT from the command line with the following syntax (windows):

java -jar wxtn.jar script.xml [-m module1[,module2]]

For instance:

java -jar C:\myWxt\dist\wxt6.jar C:\mysite\script.xml 

java -jar C:\myWxt\dist\wxt6.jar C:\mysite\script.xml -m firstpage,lastpage

You may also download the GUI, see Download , and control the building in more detail.