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.

style.html 6.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="style">Style</a></h2>
  8. <h3>Description</h3>
  9. <p>Process a set of documents via XSLT.</p>
  10. <p>This is useful for building views of XML based documentation,
  11. or in generating code.</p>
  12. <p>It is possible to refine the set of files that are being copied. This can be
  13. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  14. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  15. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  16. the files you want to have excluded. This is also done with patterns. And
  17. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  18. want to use default exclusions or not. See the section on <a
  19. href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
  20. inclusion/exclusion of files works, and how to write patterns.</p>
  21. <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and supports all
  22. attributes of <code>&lt;fileset&gt;</code> (<code>dir</code> becomes <code>basedir</code>)
  23. as well as the nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
  24. and <code>&lt;patternset&gt;</code> elements.</p>
  25. <p>Style supports the use of a &lt;param&gt; element which is used to pass values
  26. to an &lt;xsl:param&gt; declaration.</p>
  27. <h3>Parameters</h3>
  28. <table border="1" cellpadding="2" cellspacing="0">
  29. <tr>
  30. <td valign="top"><b>Attribute</b></td>
  31. <td valign="top"><b>Description</b></td>
  32. <td align="center" valign="top"><b>Required</b></td>
  33. </tr>
  34. <tr>
  35. <td valign="top">basedir</td>
  36. <td valign="top">where to find the source XML file, default is the
  37. project's basedir.</td>
  38. <td align="center" valign="top">No</td>
  39. </tr>
  40. <tr>
  41. <td valign="top">destdir</td>
  42. <td valign="top">directory in which to store the results.</td>
  43. <td align="center" valign="top">Yes, unless in and out have been
  44. specified.</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">extension</td>
  48. <td valign="top">desired file extension to be used for the targets. If not
  49. specified, the default is &quot;html&quot;.</td>
  50. <td align="center" valign="top">No</td>
  51. </tr>
  52. <tr>
  53. <td valign="top">style</td>
  54. <td valign="top">name of the stylesheet to use - given either relative
  55. to the project's basedir or as an absolute path
  56. <em><strong>DEPRECATED</strong> - can be specified as a path relative
  57. to the basedir attribute of this task as well</em>.
  58. </td>
  59. <td align="center" valign="top">Yes</td>
  60. </tr>
  61. <tr>
  62. <td valign="top">processor</td>
  63. <td valign="top">name of the XSLT processor to use. Permissible values are
  64. &quot;trax&quot; for a TraX compliant processor, &quot;xslp&quot; for the
  65. XSL:P processor, &quot;xalan&quot; for the Apache XML Xalan (version 1)
  66. processor, or the name of an arbitrary XSLTLiaison class. Defaults to trax,
  67. followed by xslp then xalan (in that order). The first one found in your
  68. class path is the one that is used.</td>
  69. <td align="center" valign="top">No</td>
  70. </tr>
  71. <tr>
  72. <td valign="top">includes</td>
  73. <td valign="top">comma separated list of patterns of files that must be included.
  74. All files are included when omitted.</td>
  75. <td valign="top" align="center">No</td>
  76. </tr>
  77. <tr>
  78. <td valign="top">includesfile</td>
  79. <td valign="top">the name of a file. Each line of this file is taken to be
  80. an include pattern</td>
  81. <td valign="top" align="center">No</td>
  82. </tr>
  83. <tr>
  84. <td valign="top">excludes</td>
  85. <td valign="top">comma separated list of patterns of files that must be excluded.
  86. No files (except default excludes) are excluded when omitted.</td>
  87. <td valign="top" align="center">No</td>
  88. </tr>
  89. <tr>
  90. <td valign="top">excludesfile</td>
  91. <td valign="top">the name of a file. Each line of this file is taken to be
  92. an exclude pattern</td>
  93. <td valign="top" align="center">No</td>
  94. </tr>
  95. <tr>
  96. <td valign="top">defaultexcludes</td>
  97. <td valign="top">indicates whether default excludes should be used or not
  98. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  99. <td valign="top" align="center">No</td>
  100. </tr>
  101. <tr>
  102. <td valign="top">in</td>
  103. <td valign="top">specifies a single XML document to be styled. Should be used
  104. with the out attribute.</td>
  105. <td valign="top" align="center">No</td>
  106. </tr>
  107. <tr>
  108. <td valign="top">out</td>
  109. <td valign="top">specifies the output name for the styled result from the
  110. in attribute.</td>
  111. <td valign="top" align="center">No</td>
  112. </tr>
  113. </table>
  114. <h3>Parameters specified as nested elements</h3>
  115. <h4>param</h4>
  116. <p>Param is used to pass a parameter to the XSL stylesheet.</p>
  117. <h4>Parameters</h4>
  118. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  119. <tr>
  120. <td valign="top"><b>Attribute</b></td>
  121. <td valign="top"><b>Description</b></td>
  122. <td align="center" valign="top"><b>Required</b></td>
  123. </tr>
  124. <tr>
  125. <td valign="top">name</td>
  126. <td valign="top">Name of the XSL parameter</td>
  127. <td align="center" valign="top">Yes</td>
  128. </tr>
  129. <tr>
  130. <td valign="top">expression</td>
  131. <td valign="top">XSL expression to be placed into the param. To pass a text
  132. value into the style sheet it needs to be escaped using single quotes.</td>
  133. <td align="center" valign="top">Yes</td>
  134. </tr>
  135. </table>
  136. <h3>Examples</h3>
  137. <blockquote>
  138. <pre>
  139. &lt;style basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  140. extension=&quot;html&quot; style=&quot;style/apache.xsl&quot;/&gt;</pre>
  141. <h4>Using XSL parameters</h4>
  142. <pre>&lt;style basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  143. extension=&quot;html&quot; style=&quot;style/apache.xsl&quot;&gt;
  144. &lt;param name=&quot;date&quot; expression=&quot;'07-01-2000'&quot;/&gt;
  145. &lt;/style&gt;</pre>
  146. <p>This will replace an xsl:param definition&lt;xsl:param name=&quot;date&quot;&gt;&lt;/xsl:param&gt;
  147. with the text value 07-01-2000 </p>
  148. </blockquote>
  149. <hr>
  150. <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  151. Reserved.</p>
  152. </body>
  153. </html>