Blogs

XSLT from HTML to DocBook with Ruby

Added by Ulrich Staudinger 297 days ago

require 'rubygems'
require 'xslt'

# Create a new XSL Transform
stylesheet_doc = XML::Document.file('html2docbook.xsl')
stylesheet = XSLT::Stylesheet.new(stylesheet_doc)

# Transform a xml document
xml_doc = XML::Document.file('TestWiki.html')
result = stylesheet.apply(xml_doc)

# dump it out
puts result

Atom RSS