NAnt SDK Documentation - v0.92 |

# StyleTask Class

Processes a document via XSLT.

For a list of all members of this type, see StyleTask Members.

System.Object
NAnt.Core.Element
NAnt.Core.Task
NAnt.Core.Tasks.StyleTask

[Visual Basic]
<TaskName(Name:="style")>
Public Class StyleTask
Inherits Task
[C#]
[TaskName(Name="style")]
public class StyleTask : Task

#### Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

#### Example

Create a report in HTML.

    <style style="report.xsl" in="data.xml" out="report.html" />

Create a report in HTML, with a param.

    <style style="report.xsl" in="data.xml" out="report.html">
        <parameters>
            <parameter name="reportType" namespaceuri="" value="Plain" />
        </parameters>
    </style>

Create a report in HTML, with a expanded param.

    <style style="report.xsl" in="data.xml" out="report.html">
        <parameters>
            <parameter name="reportType" namespaceuri="" value="${report.type}" />
        </parameters>
    </style>

Create some code based on a directory of templates.

    <style style="CodeGenerator.xsl" extension="java">
        <infiles>
            <include name="*.xml" />
        </infiles>
        <parameters>
            <parameter name="reportType" namespaceuri="" value="Plain" if="${report.plain}" />
        </parameters>
    <style>

Create a report in HTML, with an extension object.

    <style style="report.xsl" in="data.xml" out="report.html">
        <extensionobjects>
            <extensionobject namespaceuri="urn:Formatter" typename="XsltExtensionObjects.Formatter" assembly="XsltExtensionObjects.dll" />
        </extensionobjects>
    </style>

#### Requirements

Namespace: NAnt.Core.Tasks

Assembly: NAnt.Core (in NAnt.Core.dll)

#### See Also

StyleTask Members | NAnt.Core.Tasks Namespace