2007-02-28: webgen 0.4.2 released! Bugs fixed and some feature added! More...
2007-01-12: webgen 0.4.1 released! Bug fix for running webgen on Windows and other small updates! More...
2007-01-05: webgen 0.4.0 released! Major update to the core and plugins and many new features added! More...
| Plugin name: | ContentConverter/XmlBuilder (ContentConverter/Default) |
|---|---|
| Author: | Thomas Leitner <t_leitner@gmx.at> |
| Summary: | Handles content structured using the XML Builder library |
| Handler name: | xmlbuilder |
This plugin can be used to programatically create XHTML/XML documents
(Reference). The top builder object is provided through the xml
object.
Following is a short example on how to use this plugin in a page file which generates a custom XML document (the block has to be valid Ruby!):
---
outputNameStyle: [:name, ['.', :lang], '.xml']
title: Person Object
--- content, xmlbuilder
xml.persons do |p|
xml.person do |b|
b.firstname('Thomas')
b.lastname('Leitner')
end
xml.person do |b|
b.firstname('Other first')
b.lastname('Other last')
end
end
The above will produce the following output:
<persons>
<person>
<firstname>Thomas</firstname>
<lastname>Leitner</lastname>
</person>
<person>
<firstname>Other first</firstname>
<lastname>Other last</lastname>
</person>
</persons>
This plugin is only available if you have installed the builder library. The preferred way to do this is via Rubygems:
gem install builder