You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

task.dvsl 13 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. #*
  2. * DVSL Stylesheet to format the Ant Task documentation.
  3. *#
  4. #set( $relative-path = "../../" )
  5. #if (false)
  6. #set( $body-bg = '#ffffff' )
  7. #set( $body-fg = '#000000' )
  8. #set( $body-link = '#525D76' )
  9. ##set( $banner-bg = '#EEEEEE')
  10. #set( $banner-fg = '#000000')
  11. #set( $sub-banner-bg = '#828DA6')
  12. #set( $sub-banner-fg = '#ffffff')
  13. ##set( $table-th-bg = '#FFEEEE')
  14. ##set( $table-td-bg = '#FFEEEE')
  15. ##set( $source-color = '#CCFFFF')
  16. #set( $table-th-bg = '#EEEEEE')
  17. #set( $table-td-bg = '#EEEEEE')
  18. #set( $banner-bg = '#a0ddf0')
  19. ##set( $banner-bg = '#525D76')
  20. ##set( $table-th-bg = '#039acc')
  21. ##set( $table-td-bg = '#a0ddf0')
  22. #set( $source-color = '#023264')
  23. #end
  24. #set( $body-bg = '#ffffff' )
  25. #set( $body-fg = '#000000' )
  26. #set( $body-link = '#525D76' )
  27. #set( $banner-bg = '#525D76')
  28. #set( $banner-fg = '#ffffff')
  29. #set( $sub-banner-bg = '#828DA6')
  30. #set( $sub-banner-fg = '#ffffff')
  31. #set( $table-th-bg = '#cccccc')
  32. #set( $table-td-bg = '#eeeeee')
  33. #set( $source-color = '#023264')
  34. #set( $source-font-size = '+0')
  35. ## Double quote for convenience
  36. #set ($qq = '"')
  37. ## Macro to output argument if test evaluates to true
  38. #macro(ifset $test $output)
  39. #if ( $test )$output#end
  40. #end
  41. ## Macro to capitalize a word making the first letter upper case
  42. #macro(capitalize $word)
  43. $word.substring(0,1).toUpperCase()$word.substring(1)
  44. #end
  45. #match( "task" )
  46. #set( $project = $node.selectSingleNode("document('xdocs/stylesheets/project.xml')/project" ) )
  47. #if ($node.name().equals("task"))
  48. #set( $title = "#capitalize($attrib.name) Task" )
  49. #set( $summary = $node.short-description )
  50. #end
  51. <html>
  52. <head>
  53. <meta http-equiv="Content-Language" content="en-us">
  54. <title>$title</title>
  55. </head>
  56. <body bgcolor="$body-bg" text="$body-fg" link="$body-link"
  57. alink="$body-link" vlink="$body-link">
  58. <table border="0" width="100%" cellspacing="4">
  59. <!-- PAGE HEADER -->
  60. <tr>
  61. <td>
  62. <table border="0" width="100%"><tr>
  63. <td valign="bottom">
  64. <font size="+3" face="arial,helvetica,sanserif"><strong>$title</strong></font>
  65. #* *##if( $summary )
  66. <br><font face="arial,helvetica,sanserif">$summary</font>
  67. #* *##end
  68. </td>
  69. <td>
  70. #* *##if( $project.logo )
  71. #set( $alt = $project.logo )
  72. #set( $home = $project.attribute("href") )
  73. #set( $src = $project.logo.attribute( "href" ) )
  74. <!-- PROJECT LOGO -->
  75. <a href="$home">
  76. <img src="${relative-path}$src" align="right" alt="$alt" border="0"/>
  77. </a>
  78. #* *##end
  79. </td>
  80. </tr></table>
  81. </td>
  82. </tr>
  83. <!-- START RIGHT SIDE MAIN BODY -->
  84. <tr>
  85. <td valign="top" align="left">
  86. #* *##if ($node.name().equals("task"))
  87. #* Use description from merged XML if available, else javadoc comment *#
  88. #* *##if ($node.external.description)
  89. <!-- Applying task/description -->
  90. #* *#$context.applyTemplates("external/description")
  91. #* *##else
  92. <!-- Applying task/long-description -->
  93. #* *#$context.applyTemplates("long-description")
  94. #* *##end
  95. #* *#$context.applyTemplates("short-description")
  96. #* *#$context.applyTemplates("attribute/description")
  97. #* *#$context.applyTemplates("element/description")
  98. #* *#$context.applyTemplates("structure/attribute-groups")
  99. #* *#$context.applyTemplates("structure/elements")
  100. #* *#$context.applyTemplates("external/section")
  101. #* *##end
  102. </td>
  103. </tr>
  104. <!-- END RIGHT SIDE MAIN BODY -->
  105. <!-- FOOTER SEPARATOR -->
  106. <tr>
  107. <td>
  108. <hr noshade="" size="1"/>
  109. </td>
  110. </tr>
  111. <!-- PAGE FOOTER -->
  112. <tr>
  113. <td>
  114. <div align="center"><font color="$body-link" size="-1"><em>
  115. Copyright &#169; 2000-2003, Apache Software Foundation
  116. </em></font></div>
  117. </td>
  118. </tr>
  119. </table>
  120. </body>
  121. </html>
  122. #end
  123. #*
  124. Macro to format a table heading cell
  125. *#
  126. #macro( th $text )
  127. <td bgcolor="$table-th-bg" valign="top" align="left">
  128. <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>$text</b></font>
  129. </td>
  130. #end
  131. #*
  132. Macro to format a table body cell
  133. *#
  134. #macro( td $text )
  135. <td bgcolor="$table-td-bg" valign="top" align="left">
  136. <font color="#000000" size="-1" face="arial,helvetica,sanserif">$text</font>
  137. </td>
  138. #end
  139. #*
  140. Macro to format a table body cell that spans multiple rows
  141. *#
  142. #macro( tdmr $text $rows )
  143. <td bgcolor="$table-td-bg" valign="top" align="left" rowspan="$rows">
  144. <font color="#000000" size="-1" face="arial,helvetica,sanserif">$text</font>
  145. </td>
  146. #end
  147. #*
  148. Macro to format a section banner
  149. *#
  150. #macro( section $anchor $name )
  151. <tr><td bgcolor="$banner-bg">
  152. <font color="$banner-fg" face="arial,helvetica.sanserif">
  153. <a name="$anchor">
  154. <strong>$name</strong></a></font>
  155. </td></tr>
  156. #end
  157. #*
  158. Macro to format a subsection banner
  159. *#
  160. #macro( subsection $anchor $name )
  161. <tr><td bgcolor="$sub-banner-bg">
  162. <font color="$sub-banner-fg" face="arial,helvetica.sanserif">
  163. <a name="$anchor">
  164. <strong>$name</strong></a></font>
  165. </td></tr>
  166. #end
  167. #*
  168. Process javadoc long description section
  169. *#
  170. #match( "long-description" )
  171. <!-- Start Description -->
  172. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  173. <tr><td>&nbsp;</td></tr>
  174. #* *##section("description" "Description")
  175. <tr><td><blockquote>
  176. $node.value().trim()
  177. </blockquote></td></tr>
  178. </table>
  179. <!-- End Description -->
  180. #end
  181. #*
  182. Process javadoc short description section
  183. *#
  184. #match( "short-description" )
  185. <!-- Ignore -->
  186. #end
  187. #*
  188. Process javadoc attribute/description section
  189. *#
  190. #match( "attribute/description" )
  191. <!-- Ignore -->
  192. #end
  193. #*
  194. Process javadoc element/description section
  195. *#
  196. #match( "element/description" )
  197. <!-- Ignore -->
  198. #end
  199. #*
  200. Process external desciption
  201. *#
  202. #match( "external/description" )
  203. <!-- Start Description -->
  204. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  205. <tr><td>&nbsp;</td></tr>
  206. #* *##section("description" "Description")
  207. <tr><td><blockquote>
  208. #* *#$context.applyTemplates("*")
  209. </blockquote></td></tr>
  210. </table>
  211. <!-- End Description -->
  212. #end
  213. #*
  214. Process top level attributes
  215. *#
  216. #match( "structure/attribute-groups" )
  217. <!-- Start Attributes -->
  218. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  219. <tr><td>&nbsp;</td></tr>
  220. #* *##section("attributes" "Parameters")
  221. <tr><td><blockquote>
  222. <table>
  223. <tr>
  224. #* *##th("Attribute")
  225. #* *##th("Description")
  226. #* *##th("Type")
  227. #* *##th("Requirement")
  228. </tr>
  229. #* *#$context.applyTemplates("*")
  230. </table>
  231. </blockquote></td></tr>
  232. </table>
  233. <!-- End Attributes -->
  234. #end
  235. #*
  236. Process attribute group
  237. *#
  238. #match( "structure/attribute-groups/attribute-group" )
  239. <!-- Attribute Group -->
  240. #set ($attributeGroup = $attrib.description)
  241. #set ($numGroups = $node.selectNodes("attribute").size())
  242. #set ($inGroup = true)
  243. #* *#$context.applyTemplates("*")
  244. #end
  245. #*
  246. Process a single attribute
  247. *#
  248. #match( "structure/attribute-groups/attribute-group/attribute" )
  249. <!-- Attribute -->
  250. <tr>
  251. #* *##td($attrib.name)
  252. #* *##td($node.description)
  253. #* *##td($attrib.briefType)
  254. #if ($inGroup)
  255. #* *##tdmr($attributeGroup $numGroups)
  256. #set ($inGroup = false)
  257. #end
  258. </tr>
  259. #end
  260. #*
  261. Process all elements
  262. *#
  263. #match( "elements" )
  264. <!-- Start Elements -->
  265. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  266. <tr><td>&nbsp;</td></tr>
  267. #* *##section("elements" "Parameters as nested elements")
  268. <tr><td><blockquote>
  269. #* *#$context.applyTemplates("*")
  270. </blockquote></td></tr>
  271. </table>
  272. <!-- End Elements -->
  273. #end
  274. #*
  275. Process a single element
  276. *#
  277. #match( "element" )
  278. <!-- Start Element -->
  279. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  280. <tr><td>&nbsp;</td></tr>
  281. <tr><td bgcolor="$sub-banner-bg">
  282. <font color="$sub-banner-fg" face="arial,helvetica.sanserif" size="-1">
  283. <strong>$attrib.name</strong> ($attrib.type)</font>
  284. </td></tr>
  285. <tr><td><blockquote>
  286. $node.description.toString().trim()
  287. #* *#$context.applyTemplates("*")
  288. </blockquote></td></tr>
  289. </table>
  290. <!-- End Element -->
  291. #end
  292. #*
  293. Process attributes within elements
  294. *#
  295. #match( "element/attributes" )
  296. <!-- Start Attributes -->
  297. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  298. <tr><td>&nbsp;</td></tr>
  299. <tr><td>
  300. <table>
  301. <tr>
  302. #* *##th("Attribute")
  303. #* *##th("Description")
  304. #* *##th("Type")
  305. </tr>
  306. #* *#$context.applyTemplates("*")
  307. </table>
  308. </td></tr>
  309. </table>
  310. <!-- End Attributes -->
  311. #end
  312. #*
  313. * Process a menu for the navigation bar
  314. *#
  315. #match( "menu" )
  316. <tr><td>
  317. <p>
  318. <strong>$attrib.name</strong>
  319. </p>
  320. </td><td>
  321. <ul>
  322. $context.applyTemplates("item")
  323. </ul></td></tr>
  324. #end
  325. #*
  326. * Process a menu item for the navigation bar
  327. *#
  328. #match( "item" )
  329. #if( $attrib.href.endsWith("$outputfilename") && !$attrib.href.startsWith("http"))
  330. <strong>$attrib.name</strong>
  331. #else
  332. #if( $attrib.href.startsWith("http") )
  333. <a href="$attrib.href">$attrib.name</a>
  334. #else
  335. <a href="${relative-path}$attrib.href">$attrib.name</a>
  336. #end
  337. #end
  338. #end
  339. #*
  340. * process a documentation section
  341. *#
  342. #match( "section" )
  343. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  344. <tr><td>&nbsp;</td></tr>
  345. <tr><td bgcolor="$banner-bg">
  346. <font color="$banner-fg" face="arial,helvetica.sanserif">
  347. #if ( $attrib.anchor )
  348. #set( $anchor = $attrib.anchor )
  349. #else
  350. #set( $anchor = $attrib.name )
  351. #end
  352. <a name="$anchor">
  353. <strong>$attrib.name</strong></a></font>
  354. </td></tr>
  355. <tr><td><blockquote>
  356. $context.applyTemplates("*")
  357. </blockquote></td></tr>
  358. </table>
  359. #end
  360. #match( "subsection" )
  361. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  362. <!-- Subsection heading -->
  363. <tr><td bgcolor="$sub-banner-bg">
  364. <font color="$sub-banner-fg" face="arial,helvetica.sanserif">
  365. #if ( $attrib.anchor )
  366. #set( $anchor = $attrib.anchor )
  367. #else
  368. #set( $anchor = $attrib.name )
  369. #end
  370. <a name="$anchor">
  371. <strong>$attrib.name</strong></a></font>
  372. </td></tr>
  373. <!-- Subsection body -->
  374. <tr><td>
  375. $context.applyTemplates("*")
  376. </td></tr>
  377. </table>
  378. #end
  379. #*
  380. * process a the requirement groups
  381. *#
  382. #match( "requirement-group" )
  383. #if ($regGroup == $attrib.name)
  384. #* *#$attrib.description
  385. #end
  386. #end
  387. #match( "source" )
  388. <div align="left">
  389. <table cellspacing="4" cellpadding="0" border="0">
  390. <tr>
  391. <td bgcolor="$source-color" width="1" height="1">
  392. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  393. </td>
  394. <td bgcolor="$source-color" height="1">
  395. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  396. </td>
  397. <td bgcolor="$source-color" width="1" height="1">
  398. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  399. </td>
  400. </tr>
  401. <tr>
  402. <td bgcolor="$source-color" width="1">
  403. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  404. </td>
  405. <td bgcolor="#ffffff" height="1">
  406. <font size="$source-font-size"><pre>$toolbox.htmlescape.getText( $node.value() )</pre></font>
  407. </td>
  408. <td bgcolor="$source-color" width="1">
  409. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  410. </td>
  411. </tr>
  412. <tr>
  413. <td bgcolor="$source-color" width="1" height="1">
  414. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  415. </td>
  416. <td bgcolor="$source-color" height="1">
  417. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  418. </td>
  419. <td bgcolor="$source-color" width="1" height="1">
  420. <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
  421. </td>
  422. </tr>
  423. </table>
  424. </div>
  425. #end
  426. #match("table")
  427. <table>
  428. $context.applyTemplates("*")
  429. </table>
  430. #end
  431. #match("tr")
  432. <tr>
  433. $context.applyTemplates("*")
  434. </tr>
  435. #end
  436. #match( "td" )
  437. <td bgcolor="$table-td-bg" #*
  438. *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
  439. *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
  440. *#valign="top" align="left">
  441. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  442. $node.copy( $node.children() )
  443. </font>
  444. </td>
  445. #end
  446. #match( "th" )
  447. <td bgcolor="$table-th-bg" #*
  448. *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
  449. *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
  450. *#valign="top" align="left">
  451. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  452. <b>$node.copy( $node.children())</b>
  453. </font>
  454. </td>
  455. #end
  456. #match("*")
  457. $node.copy()
  458. #end