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 21 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>XSLT Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="style">XSLT</a></h2>
  23. <p><em>The name <code>style</code> is a deprecated name for the same task.</em></p>
  24. <h3>Description</h3>
  25. <p>Process a set of documents via XSLT.</p>
  26. <p>This is useful for building views of XML based documentation,
  27. or for generating code.</p>
  28. <p><b>Note:</b> If you are using JDK 1.4 or higher, this task does not require external libraries
  29. not supplied in the Apache Ant distribution. However, often the built in XSL engine is not as up
  30. to date as a fresh download, so an update is still highly recommended
  31. in particular since the built-in XSLT processors of Java 5 (and to a
  32. certain extent Java 6) are known to have serious issues.
  33. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more information.</p>
  34. <p>It is possible to refine the set of files that are being processed. This can be
  35. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  36. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  37. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  38. the files you want to have excluded. This is also done with patterns. And
  39. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  40. want to use default exclusions or not. See the section on <a
  41. href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
  42. inclusion/exclusion of files works, and how to write patterns.</p>
  43. <p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports all
  44. attributes of <code>&lt;fileset&gt;</code> (<code>dir</code> becomes <code>basedir</code>)
  45. as well as the nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
  46. and <code>&lt;patternset&gt;</code> elements.</p>
  47. <p><b>Note</b>: Unlike other similar tasks, this task treats
  48. directories that have been matched by the include/exclude patterns of
  49. the implicit fileset in a special way. It will apply the stylesheets
  50. to all files contain in them as well. Since the default include
  51. pattern is <code>**</code> this means it will apply the stylesheet to
  52. all files. If you specify an excludes pattern, it may still work on
  53. the files matched by those patterns because the parent directory has
  54. been matched. If this behavior is not what you want, set the
  55. scanincludedirectories attribute to false.</p>
  56. <p>Starting with Ant 1.7 this task supports nested <a
  57. href="../Types/resources.html#collection">resource collection</a>s
  58. in addition to (or instead of, depending on the useImplicitFileset
  59. attribute) the implicit fileset formed by this task.</p>
  60. <p>This task supports the use of a nested <code>&lt;param&gt;</code> element which is used to pass values
  61. to an <code>&lt;xsl:param&gt;</code> declaration.</p>
  62. <p>This task supports the use of a nested <a href="../Types/xmlcatalog.html">xmlcatalog</a>
  63. element which is used to perform Entity and URI resolution.</p>
  64. <h3>Parameters</h3>
  65. <table border="1" cellpadding="2" cellspacing="0">
  66. <tr>
  67. <td valign="top"><b>Attribute</b></td>
  68. <td valign="top"><b>Description</b></td>
  69. <td align="center" valign="top"><b>Required</b></td>
  70. </tr>
  71. <tr>
  72. <td valign="top">basedir</td>
  73. <td valign="top">where to find the source XML file, default is the
  74. project's basedir.</td>
  75. <td align="center" valign="top">No</td>
  76. </tr>
  77. <tr>
  78. <td valign="top">destdir</td>
  79. <td valign="top">directory in which to store the results.</td>
  80. <td align="center" valign="top">Yes, unless in and out have been
  81. specified.</td>
  82. </tr>
  83. <tr>
  84. <td valign="top">extension</td>
  85. <td valign="top">desired file extension to be used for the targets. If not
  86. specified, the default is &quot;.html&quot;. Will be ignored if
  87. a nested <code>&lt;mapper&gt;</code> has been specified.</td>
  88. <td align="center" valign="top">No</td>
  89. </tr>
  90. <tr>
  91. <td valign="top">style</td>
  92. <td valign="top">name of the stylesheet to use - given either relative
  93. to the project's basedir or as an absolute path.<br/>
  94. <br/>
  95. Alternatively, a nested element which ant can interpret as a resource
  96. can be used to indicate where to find the stylesheet<br/>
  97. <em>deprecated variation :</em> <br/>
  98. If the stylesheet cannot be found, and if you have specified the
  99. attribute basedir for the task, ant will assume that the style
  100. attribute is relative to the basedir of the task.
  101. </td>
  102. <td align="center" valign="top">No, if the location of
  103. the stylesheet is specified using a nested &lt;style&gt; element</td>
  104. </tr>
  105. <tr>
  106. <td valign="top">classpath</td>
  107. <td valign="top">the classpath to use when looking up the XSLT
  108. processor.</td>
  109. <td align="center" valign="top">No</td>
  110. </tr>
  111. <tr>
  112. <td valign="top">classpathref</td>
  113. <td valign="top">the classpath to use, given as <a
  114. href="../using.html#references">reference</a> to a path defined elsewhere.</td>
  115. <td align="center" valign="top">No</td>
  116. </tr>
  117. <tr>
  118. <td valign="top">force</td>
  119. <td valign="top">Recreate target files, even if they are newer
  120. than their corresponding source files or the stylesheet.</td>
  121. <td valign="top" align="center">No; default is false</td>
  122. </tr>
  123. <tr>
  124. <td valign="top">processor</td>
  125. <td valign="top">name of the XSLT processor to use.
  126. Permissible value is :<ul>
  127. <li>&quot;trax&quot; for a TraX compliant processor (ie JAXP interface
  128. implementation such as Xalan 2 or Saxon)</li></ul>
  129. Defaults to trax.
  130. <br/>
  131. Support for xalan1 has been removed in ant 1.7.
  132. </td>
  133. <td align="center" valign="top">No</td>
  134. </tr>
  135. <tr>
  136. <td valign="top">includes</td>
  137. <td valign="top">comma- or space-separated list of patterns of files that must be included.
  138. All files are included when omitted.</td>
  139. <td valign="top" align="center">No</td>
  140. </tr>
  141. <tr>
  142. <td valign="top">includesfile</td>
  143. <td valign="top">the name of a file. Each line of this file is taken to be
  144. an include pattern</td>
  145. <td valign="top" align="center">No</td>
  146. </tr>
  147. <tr>
  148. <td valign="top">excludes</td>
  149. <td valign="top">comma- or space-separated list of patterns of files that must be excluded.
  150. No files (except default excludes) are excluded when omitted.</td>
  151. <td valign="top" align="center">No</td>
  152. </tr>
  153. <tr>
  154. <td valign="top">excludesfile</td>
  155. <td valign="top">the name of a file. Each line of this file is taken to be
  156. an exclude pattern</td>
  157. <td valign="top" align="center">No</td>
  158. </tr>
  159. <tr>
  160. <td valign="top">defaultexcludes</td>
  161. <td valign="top">indicates whether default excludes should be used or not
  162. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  163. <td valign="top" align="center">No</td>
  164. </tr>
  165. <tr>
  166. <td valign="top">in</td>
  167. <td valign="top">specifies a single XML document to be styled. Should be used
  168. with the out attribute.</td>
  169. <td valign="top" align="center">No</td>
  170. </tr>
  171. <tr>
  172. <td valign="top">out</td>
  173. <td valign="top">specifies the output name for the styled result from the
  174. in attribute.</td>
  175. <td valign="top" align="center">No</td>
  176. </tr>
  177. <tr>
  178. <td valign="top">scanincludeddirectories</td>
  179. <td valign="top">If any directories are matched by the
  180. includes/excludes patterns, try to transform all files in these
  181. directories. Default is <code>true</code></td>
  182. <td valign="top" align="center">No</td>
  183. </tr>
  184. <tr>
  185. <td valign="top">reloadstylesheet</td>
  186. <td valign="top">Control whether the stylesheet transformer is created
  187. anew for every transform operation. If you set this to true, performance may
  188. suffer, but you may work around a bug in certain Xalan-J versions.
  189. Default is <code>false</code>. <em>Since Ant 1.5.2</em>.</td>
  190. <td valign="top" align="center">No</td>
  191. </tr>
  192. <tr>
  193. <td valign="top">useImplicitFileset</td>
  194. <td valign="top">Whether the implicit fileset formed by this task
  195. shall be used. If you set this to false you must use nested
  196. resource collections - or the in attribute, in which case this
  197. attribute has no impact anyway. Default is <code>true</code>.
  198. <em>Since Ant 1.7</em>.</td>
  199. <td valign="top" align="center">No</td>
  200. </tr>
  201. <tr>
  202. <td valign="top">filenameparameter</td>
  203. <td valign="top">Specifies a xsl parameter for accessing the name
  204. of the current processed file. If not set, the file name is not
  205. passed to the transformation.
  206. <em>Since Ant 1.7</em>.</td>
  207. <td valign="top" align="center">No</td>
  208. </tr>
  209. <tr>
  210. <td valign="top">filedirparameter</td>
  211. <td valign="top">Specifies a xsl parameter for accessing the directory
  212. of the current processed file. For files in the current directory a
  213. value of '.' will be passed to the transformation.
  214. If not set, the directory is not passed to the transformation.
  215. <em>Since Ant 1.7</em>.</td>
  216. <td valign="top" align="center">No</td>
  217. </tr>
  218. <tr>
  219. <td valign="top">supressWarnings</td>
  220. <td valign="top">Whether processor warnings shall be suppressed.
  221. This option requires support by the processor, it is supported by
  222. the trax processor bundled with Ant.
  223. <em>Since Ant 1.8.0</em>.</td>
  224. <td valign="top" align="center">No, default is false.</td>
  225. </tr>
  226. <tr>
  227. <td valign="top">failOnError</td>
  228. <td valign="top">Whether the build should fail if any error
  229. occurs. Note that transformation errors can still be suppressed by
  230. setting failOnTransformationError to false even if this attribute
  231. is true.
  232. <em>Since Ant 1.8.0</em>.</td>
  233. <td valign="top" align="center">No, default is true.</td>
  234. </tr>
  235. <tr>
  236. <td valign="top">failOnTransformationError</td>
  237. <td valign="top">Whether the build should fail if an error occurs
  238. while transforming the document. Note that this attribute has no
  239. effect of <code>failOnError</code> is false.
  240. <em>Since Ant 1.8.0</em>.</td>
  241. <td valign="top" align="center">No, default is true.</td>
  242. </tr>
  243. <tr>
  244. <td valign="top">failOnNoResources</td>
  245. <td valign="top">Whether the build should fail if the nested
  246. resource collection is empty. Note that this attribute has no
  247. effect of <code>failOnError</code> is false.
  248. <em>Since Ant 1.8.0</em>.</td>
  249. <td valign="top" align="center">No, default is true.</td>
  250. </tr>
  251. </table>
  252. <h3>Parameters specified as nested elements</h3>
  253. <h4>any <a href="../Types/resources.html#collection">resource
  254. collection</a></h4>
  255. <p><em>since Ant 1.7</em></p>
  256. <p>Use resource collections to specify resources that the stylesheet
  257. should be applied to. Use a nested mapper and the task's destdir
  258. attribute to specify the output files.</p>
  259. <h4>classpath</h4>
  260. <p>The classpath to load the processor from can be specified via a
  261. nested <code>&lt;classpath&gt;</code>, as well - that is, a
  262. <a href="../using.html#path">path</a>-like structure.</p>
  263. <h4>xmlcatalog</h4>
  264. <p>The <a href="../Types/xmlcatalog.html">xmlcatalog</a>
  265. element is used to perform Entity and URI resolution.</p>
  266. <h4>param</h4>
  267. <p>Param is used to pass a parameter to the XSL stylesheet.</p>
  268. <blockquote>
  269. <h4>Parameters</h4>
  270. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  271. <tr>
  272. <td valign="top"><b>Attribute</b></td>
  273. <td valign="top"><b>Description</b></td>
  274. <td align="center" valign="top"><b>Required</b></td>
  275. </tr>
  276. <tr>
  277. <td valign="top">name</td>
  278. <td valign="top">Name of the XSL parameter</td>
  279. <td align="center" valign="top">Yes</td>
  280. </tr>
  281. <tr>
  282. <td valign="top">expression</td>
  283. <td valign="top">Text value to be placed into the param.<br>
  284. Was originally intended to be an XSL expression.</td>
  285. <td align="center" valign="top">Yes</td>
  286. </tr>
  287. <tr>
  288. <td valign="top">if</td>
  289. <td valign="top">The param will only be passed <a href="../properties.html#if+unless">if this property is set</a>.</td>
  290. <td align="center" valign="top">No</td>
  291. </tr>
  292. <tr>
  293. <td valign="top">unless</td>
  294. <td valign="top">The param will not be passed <a href="../properties.html#if+unless">if this property is set</a>.</td>
  295. <td align="center" valign="top">No</td>
  296. </tr>
  297. </table>
  298. </blockquote>
  299. <h4>outputproperty ('trax' processors only)</h4>
  300. <p>Used to specify how you wish the result tree to be output
  301. as specified in the <a href="http://www.w3.org/TR/xslt#output">
  302. XSLT specifications</a>.
  303. <blockquote>
  304. <h4>Parameters</h4>
  305. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  306. <tr>
  307. <td valign="top"><b>Attribute</b></td>
  308. <td valign="top"><b>Description</b></td>
  309. <td align="center" valign="top"><b>Required</b></td>
  310. </tr>
  311. <tr>
  312. <td valign="top">name</td>
  313. <td valign="top">Name of the property</td>
  314. <td align="center" valign="top">Yes</td>
  315. </tr>
  316. <tr>
  317. <td valign="top">value</td>
  318. <td valign="top">value of the property.</td>
  319. <td align="center" valign="top">Yes</td>
  320. </tr>
  321. </table>
  322. </blockquote>
  323. <h4>factory ('trax' processors only)</h4>
  324. Used to specify factory settings.
  325. <blockquote>
  326. <h4>Parameters</h4>
  327. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  328. <tr>
  329. <td valign="top"><b>Attribute</b></td>
  330. <td valign="top"><b>Description</b></td>
  331. <td align="center" valign="top"><b>Required</b></td>
  332. </tr>
  333. <tr>
  334. <td valign="top">name</td>
  335. <td valign="top">fully qualified classname of the
  336. transformer factory to use. For example
  337. <tt>org.apache.xalan.processor.TransformerFactoryImpl</tt>
  338. or <tt>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</tt>
  339. or <tt>net.sf.saxon.TransformerFactoryImpl</tt>...
  340. </td>
  341. <td align="center" valign="top">No. Defaults to the JAXP lookup mechanism.</td>
  342. </tr>
  343. </table>
  344. <h3>Parameters specified as nested elements</h3>
  345. <h4>attribute </h4>
  346. <p>Used to specify settings of the processor factory.
  347. The attribute names and values are entirely processor specific
  348. so you must be aware of the implementation to figure them out.
  349. Read the documentation of your processor.
  350. For example, in Xalan 2.x:
  351. <ul>
  352. <li>http://xml.apache.org/xalan/features/optimize (boolean)</li>
  353. <li>http://xml.apache.org/xalan/features/incremental (boolean)</li>
  354. <li>...</li>
  355. </ul>
  356. And in Saxon 7.x:
  357. <ul>
  358. <li>http://saxon.sf.net/feature/allow-external-functions (boolean)</li>
  359. <li>http://saxon.sf.net/feature/timing (boolean)</li>
  360. <li>http://saxon.sf.net/feature/traceListener (string)</li>
  361. <li>http://saxon.sf.net/feature/treeModel (integer)</li>
  362. <li>http://saxon.sf.net/feature/linenumbering (integer)</li>
  363. <li>...</li>
  364. </ul>
  365. <blockquote>
  366. <h4>Parameters</h4>
  367. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  368. <tr>
  369. <td valign="top"><b>Attribute</b></td>
  370. <td valign="top"><b>Description</b></td>
  371. <td align="center" valign="top"><b>Required</b></td>
  372. </tr>
  373. <tr>
  374. <td valign="top">name</td>
  375. <td valign="top">Name of the attribute</td>
  376. <td align="center" valign="top">Yes</td>
  377. </tr>
  378. <tr>
  379. <td valign="top">value</td>
  380. <td valign="top">value of the attribute.</td>
  381. <td align="center" valign="top">Yes</td>
  382. </tr>
  383. </table>
  384. </blockquote>
  385. </blockquote>
  386. <h4>mapper</h4>
  387. <p><em>since Ant 1.6.2</em></p>
  388. <p>You can define filename transformations by using a nested <a
  389. href="../Types/mapper.html">mapper</a> element. The default mapper
  390. used by <code>&lt;xslt&gt;</code> removes the file extension from the
  391. source file and adds the extension specified via the extension
  392. attribute.</p>
  393. <h4>style</h4>
  394. <p><em>Since Ant 1.7</em></p>
  395. <p>The nested style element can be used to specify your stylesheet in terms
  396. of Ant's <a href="../Types/resources.html">resource</a> types. With
  397. this element, the stylesheet should be specified as a nested resource or
  398. single-element collection. Alternatively, use the <code>refid</code> to
  399. specify the resource or collection as a reference.</p>
  400. <h4>sysproperty</h4>
  401. <p>Use nested <code>&lt;sysproperty&gt;</code> elements to specify
  402. system properties required by the factory or transformation. These
  403. properties will be made available to the VM during the execution of
  404. the class. The attributes for this element are the same as
  405. for <a href="exec.html#env">environment variables</a>.</p>
  406. <p><em>since Ant 1.8.0</em>.</p>
  407. <h4>syspropertyset</h4>
  408. <p>You can specify a set of properties to be used as system properties
  409. with <a href="../Types/propertyset.html">syspropertyset</a>s.</p>
  410. <p><em>since Ant 1.8.0</em>.</p>
  411. <h3>Examples</h3>
  412. <blockquote>
  413. <pre>
  414. &lt;xslt basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  415. extension=&quot;.html&quot; style=&quot;style/apache.xsl&quot;/&gt;</pre>
  416. <h4>Using an xmlcatalog</h4>
  417. <pre>
  418. &lt;xslt basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  419. extension=&quot;.html&quot; style=&quot;style/apache.xsl&quot;&gt;
  420. &lt;xmlcatalog refid=&quot;mycatalog&quot;/&gt;
  421. &lt;/xslt&gt;
  422. &lt;xslt basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  423. extension=&quot;.html&quot; style=&quot;style/apache.xsl&quot;&gt;
  424. &lt;xmlcatalog&gt;
  425. &lt;dtd
  426. publicId=&quot;-//ArielPartners//DTD XML Article V1.0//EN&quot;
  427. location=&quot;com/arielpartners/knowledgebase/dtd/article.dtd&quot;/&gt;
  428. &lt;/xmlcatalog&gt;
  429. &lt;/xslt&gt;
  430. </pre>
  431. <h4>Using XSL parameters</h4>
  432. <pre>
  433. &lt;xslt basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  434. extension=&quot;.html&quot; style=&quot;style/apache.xsl&quot;&gt;
  435. &lt;param name=&quot;date&quot; expression=&quot;07-01-2000&quot;/&gt;
  436. &lt;/xslt&gt;</pre>
  437. <p>Then if you declare a global parameter &quot;date&quot; with the top-level
  438. element &lt;xsl:param name=&quot;date&quot;/&gt;, the variable
  439. <code>$date</code> will subsequently have the value 07-01-2000.
  440. </p>
  441. <h4>Using output properties</h4>
  442. <pre>
  443. &lt;xslt in=&quot;doc.xml&quot; out=&quot;build/doc/output.xml&quot;
  444. style=&quot;style/apache.xsl&quot;&gt;
  445. &lt;outputproperty name=&quot;method&quot; value=&quot;xml&quot;/&gt;
  446. &lt;outputproperty name=&quot;standalone&quot; value=&quot;yes&quot;/&gt;
  447. &lt;outputproperty name=&quot;encoding&quot; value=&quot;iso8859_1&quot;/&gt;
  448. &lt;outputproperty name=&quot;indent&quot; value=&quot;yes&quot;/&gt;
  449. &lt;/xslt&gt;
  450. </pre>
  451. <h4>Using factory settings</h4>
  452. <pre>
  453. &lt;xslt in=&quot;doc.xml&quot; out=&quot;build/doc/output.xml&quot;
  454. style=&quot;style/apache.xsl&quot;&gt;
  455. &lt;factory name=&quot;org.apache.xalan.processor.TransformerFactoryImpl&quot;&gt;
  456. &lt;attribute name=&quot;http://xml.apache.org/xalan/features/optimize&quot; value=&quot;true&quot;/&gt;
  457. &lt;/factory&gt;
  458. &lt;/xslt&gt;</pre>
  459. <h4>Using a mapper</h4>
  460. <pre>
  461. &lt;xslt basedir=&quot;in&quot; destdir=&quot;out&quot;
  462. style=&quot;style/apache.xsl&quot;&gt;
  463. &lt;mapper type=&quot;glob&quot; from=&quot;*.xml.en&quot; to=&quot;*.html.en&quot;/&gt;
  464. &lt;/xslt&gt;</pre>
  465. <h4>Using a nested resource to define the stylesheet</h4>
  466. <pre>
  467. &lt;xslt in="data.xml" out="${out.dir}/out.xml"&gt;
  468. &lt;style&gt;
  469. &lt;url url="${printParams.xsl.url}"/&gt;
  470. &lt;/style&gt;
  471. &lt;param name="set" expression="value"/&gt;
  472. &lt;/xslt&gt;</pre>
  473. <h4>Print the current processed file name</h4>
  474. <pre>
  475. &lt;project&gt;
  476. &lt;xslt style=&quot;printFilename.xsl&quot; destdir=&quot;out&quot; basedir=&quot;in&quot; extension=&quot;.txt&quot;
  477. filenameparameter=&quot;filename&quot;
  478. filedirparameter=&quot;filedir&quot;
  479. /&gt;
  480. &lt;/project&gt;
  481. &lt;xsl:stylesheet
  482. version=&quot;1.0&quot;
  483. xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
  484. &lt;xsl:param name=&quot;filename&quot;&gt;&lt;/xsl:param&gt;
  485. &lt;xsl:param name=&quot;filedir&quot;&gt;.&lt;/xsl:param&gt;
  486. &lt;xsl:template match=&quot;/&quot;&gt;
  487. Current file is &lt;xsl:value-of select=&quot;$filename&quot;/&gt; in directory &lt;xsl:value-of select=&quot;$filedir&quot;/&gt;.
  488. &lt;/xsl:template&gt;
  489. &lt;/xsl:stylesheet&gt;
  490. </pre>
  491. <h4>Use an XInclude-aware version of Xerces while transforming</h4>
  492. <pre>
  493. &lt;xslt ...&gt;
  494. &lt;sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration"
  495. value="org.apache.xerces.parsers.XIncludeParserConfiguration"
  496. /&gt;
  497. &lt;xslt&gt;
  498. </pre>
  499. </blockquote>
  500. </body>
  501. </html>