## Defined variables
#set ($bodybg = "#ffffff")
#set ($bodyfg = "#000000")
#set ($bodylink = "#525D76")
#set ($bannerbg = "#525D76")
#set ($bannerfg = "#ffffff")
#set ($subbannerbg = "#828DA6")
#set ($subbannerfg = "#ffffff")
#set ($tablethbg = "#039acc")
#set ($tabletdbg = "#a0ddf0")
#set ($pound = "#" )
#faqs()
## This is where the FAQ specific macro's live
#macro (toc $section)
$section.getAttributeValue("title")
|
#foreach ($faq in $section.getChildren("faq") )
#subtoc ($faq)
#end
|
#end
#macro (subtoc $faq)
#set ($id = $faq.getAttributeValue("id"))
$xmlout.outputString($faq.getChild("question"), true)
#end
#macro (answers $section)
#foreach ($faq in $section.getChildren("faq") )
#faq ($faq)
#end
#end
#macro (faq $faq)
#set ($id = $faq.getAttributeValue("id"))
$xmlout.outputString($faq.getChild("question"), true)
|
#foreach ($item in $faq.getChild("answer").getChildren())
#if ($item.getName().equals("img"))
#image ($item)
#elseif ($item.getName().equals("source"))
#source ($item)
#elseif ($item.getName().equals("table"))
#table ($item)
#else
$xmlout.outputString($item)
#end
#end
|
#end
#macro (faqs)
#header()
Questions
|
#set ($allFaqSections = $root.getChildren("faqsection"))
#foreach ( $faqSection in $allFaqSections )
#toc ($faqSection)
#end
|
Answers
|
#foreach ( $faqSection in $allFaqSections )
#answers ($faqSection)
#end
|
#footer()
#end