File: faq.vsl

package info (click to toggle)
libbsf-java 1%3A2.3.0%2Bcvs20050308a-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,460 kB
  • ctags: 1,264
  • sloc: java: 7,643; cpp: 2,514; xml: 1,773; jsp: 463; ansic: 182; makefile: 61; python: 45; sh: 29
file content (118 lines) | stat: -rw-r--r-- 3,111 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!-- Content Stylesheet for Site -->

    ## 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 = "#" )
    
<!-- start the processing -->
#faqs()
<!-- end the processing -->

## This is where the FAQ specific macro's live

#macro (toc $section)
  <table border="0" cellspacing="0" cellpadding="2" width="100%">
    <tr><td bgcolor="$subbannerbg">
      <font color="$subbannerfg" face="arial,helvetica,sanserif">
        <strong>$section.getAttributeValue("title")</strong>
      </font>
    </td></tr>
    <tr><td>
      <blockquote>
        <ul>
        #foreach ($faq in $section.getChildren("faq") )
          #subtoc ($faq)
        #end
        </ul>
      </blockquote>
    </td></tr>
  </table>
#end

#macro (subtoc $faq)
  #set ($id = $faq.getAttributeValue("id"))
  <li><a href="$pound$id">
  $xmlout.outputString($faq.getChild("question"), true)
  </a></li>
#end

#macro (answers $section)
  #foreach ($faq in $section.getChildren("faq") )
    #faq ($faq)
  #end
#end

#macro (faq $faq)
  #set ($id = $faq.getAttributeValue("id"))
  <a name="$id">
  <table border="0" cellspacing="0" cellpadding="2" width="100%">
    <tr><td bgcolor="$subbannerbg">
      <font color="$subbannerfg" face="arial,helvetica,sanserif">
        <strong>
          $xmlout.outputString($faq.getChild("question"), true)
        </strong>
      </font>
    </td></tr>
    <tr><td>
      <blockquote>
        #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
      </blockquote>
    </td></tr>
  </table>
  </a>
#end

#macro (faqs)
  #header()
  <table border="0" cellspacing="0" cellpadding="2" width="100%">
    <tr><td bgcolor="$bannerbg">
      <font color="$bannerfg" face="arial,helvetica,sanserif">
        <strong>Questions</strong>
      </font>
    </td></tr>
    <tr><td>
      <blockquote>
      #set ($allFaqSections = $root.getChildren("faqsection"))
      #foreach ( $faqSection in $allFaqSections )
        #toc ($faqSection)
      #end
      </blockquote>
    </td></tr>
  </table>

  <table border="0" cellspacing="0" cellpadding="2" width="100%">
    <tr><td bgcolor="$bannerbg">
      <font color="$bannerfg" face="arial,helvetica,sanserif">
        <strong>Answers</strong>
      </font>
    </td></tr>
    <tr><td>
      <blockquote>
      #foreach ( $faqSection in $allFaqSections )
        #answers ($faqSection)
      #end
      </blockquote>
    </td></tr>
  </table>
  #footer()
#end