B.39 XsltTask
Prev | Appendix B. Core tasks | Next

## B.39 XsltTask

With `XsltTask`, you can run a XSLT transformation on an XML file. Actually, `XsltTask` extends `CopyTask`, so you can use all the elements allowed there.

`XsltTask` is implemented by means of the `XsltFlter` and hence relies on PHP5 XSLT support via (`libxslt`) which must be available in php5. The `XsltTask` is equivalent to running command line `xsltproc` since that is a frontend for libxslt.

Table B.42: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`style` | `String` | The path where the Xslt file is located | n/a | Yes
`resolvedocumentexternals` | `Boolean` | Whether to resolve entities in the XML document. (see this link for details) | `false` | No
`resolvestylesheetexternals` | `Boolean` | Whether to resolve entities in the stylesheet. | `false` | No

`Note:` You can also use all the attributes available for Section B.9, “CopyTask ”.

### B.39.1 Examples

    <!-- Transform docbook with an imaginary XSLT file -->
    <xslt todir="/srv/docs/phing" style="dbk2html.xslt" >
      <fileset dir=".">
        <include name="**/*.xml" />
      </fileset>
    </xslt>

### B.39.2 Supported Nested Tags

- `mapper`

- `filterchain`

- `param`

`Note:` You can use all the elements also available for Section B.9, “CopyTask ”.

Additionally, you can use `<param>` tags with a `name` and a `expression` (or `value` alias) attribute. These parameters are then available from within the xsl style sheet.

Prev | Up | Next
B.38 WaitForTask | Home | Appendix C. Optional tasks