July 2, 2003
Just for fun, I wrote the following Anakia stylesheet to translate xdocs into Wiki. It's not really complete (could use a little work). If someone else can extend it or make better use of it, please use it.
## START THE PROCESSING
#document()
## END THE PROCESSING
##################################################################################################
#macro ( image $value )$value.getAttributeValue("src")#end
##################################################################################################
#macro ( imageurl $value )$value#end
##################################################################################################
## implements simple hierarchal tables
## Doesn't really work right now
#macro ( table $node )
#foreach ( $items in $node.Children)#if ($items.Name.equalsIgnoreCase("TR"))#tablerow($items)#end#end#end
#macro (tablerow $node)
#foreach ( $items in $node.getChildren())#if ($items.Name.equalsIgnoreCase("TD"))| #parsecontent($items.content)#elseif ($items.getName().equalsIgnoreCase("th"))| <B>#parsecontent($items.content)</B>#end#end#end
##################################################################################################
#macro ( source $value)
<pre>$escape.getText($value.getText())</pre>
#end
##################################################################################################
#macro ( subsection $subsection)
=== $subsection.getAttributeValue("name") ===
#parsecontent($subsection.getChildren())
#end
##################################################################################################
#macro ( section $section)
== $section.getAttributeValue("name") ==
#parsecontent($section.getChildren())
#end
##################################################################################################
#macro ( paragraph $node)
#parsecontent($node.content)
#end
##################################################################################################
#macro ( font $node)#parsecontent($node.content)#end
##################################################################################################
#macro ( link $node)[$!node.getAttribute("href").Value$!node.getAttribute("HREF").Value $node.Text]#end
##################################################################################################
#macro ( unorderedlist $node)
#foreach ( $items in $node.getChildren())
#if ($items.getName().equalsIgnoreCase("LI"))* #parsecontent($items.content)#end#end#end
##################################################################################################
#macro ( orderedlist $node)
#foreach ( $items in $node.getChildren())
#if ($items.getName().equalsIgnoreCase("LI"))# #parsecontent($items.content)#end#end#end
##################################################################################################
#macro (parsecontent $children)#foreach ( $items in $children )#if ($items.getName().equalsIgnoreCase("img"))#image ($items)#elseif ($items.getName().equalsIgnoreCase("section"))#section ($items)#elseif ($items.getName().equalsIgnoreCase("subsection"))#subsection ($items)#elseif ($items.getName().equalsIgnoreCase("source"))#source ($items)#elseif ($items.getName().equalsIgnoreCase("table"))#table ($items)#elseif ($items.getName().equalsIgnoreCase("P"))#paragraph($items)#elseif ($items.getName().equalsIgnoreCase("UL"))#unorderedlist($items)#elseif ($items.getName().equalsIgnoreCase("OL"))#orderedlist($items)#elseif ($items.getName().equalsIgnoreCase("DIV"))#parsecontent($items.content)#elseif ($items.getName().equalsIgnoreCase("FONT"))#font($items)#elseif ($items.getName().equalsIgnoreCase("A"))#link($items)#elseif ($items.getName().equalsIgnoreCase("I"))<I>#parsecontent($items.content)</I>#elseif ($items.getName().equalsIgnoreCase("EM"))<EM>#parsecontent($items.content)</EM>#elseif ($items.content)#parsecontent($items.content)#else#**#$items.Text#end#end#end
##################################################################################################
#macro (getProjectImage)#imageurl("http://jakarta.apache.org/images/jakarta-logo.gif")#end
##################################################################################################
#macro (document)
## PAGE HEADER
## DOCUMENT BODY
## LOOP THROUGH ALL SECTIONS
#set ($allSections = $root.getChild("body").getChildren("section"))#foreach ( $section in $allSections )#section ($section)#end
## PAGE FOOTER
##----
#end