Sha256: 8c6bcc458f01f18ffc4f2d73a0df5e99efa0b32c9672f44669a8b0a8c8931a22

Contents?: true

Size: 1.22 KB

Versions: 6

Compression:

Stored size: 1.22 KB

Contents

---
title: XmlBuilder
inMenu: true
template: /plugin.template
plugin: ContentConverter/XmlBuilder
---
h2(#description). Description


This plugin can be used to programatically create XHTML/XML documents
("Reference":http://builder.rubyforge.org). The top builder object is provided through the @xml@
object.


h2(#examples). Examples


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!):

<pre>
\---
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
</pre>

The above will produce the following output:

<pre>
<persons>
  <person>
    <firstname>Thomas</firstname>
    <lastname>Leitner</lastname>
  </person>
  <person>
    <firstname>Other first</firstname>
    <lastname>Other last</lastname>
  </person>
</persons>
</pre>


h2(#caveat). Caveat


This plugin is only available if you have installed the
"builder":http://builder.rubyforge.org library. The preferred way to do this is via
Rubygems:

  gem install builder

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
webgen-0.4.2 doc/src/documentation/plugins/contentconverter/xmlbuilder.page
webgen-0.4.5 doc/src/documentation/plugins/contentconverter/xmlbuilder.page
webgen-0.4.3 doc/src/documentation/plugins/contentconverter/xmlbuilder.page
webgen-0.4.4 doc/src/documentation/plugins/contentconverter/xmlbuilder.page
webgen-0.4.6 doc/src/documentation/plugins/contentconverter/xmlbuilder.page
webgen-0.4.7 doc/src/documentation/plugins/contentconverter/xmlbuilder.page