<style>

Processes a document via XSLT.

Parameters

Attribute Type Description Required
style
URI or path that points to the stylesheet to use. If given as path, it can be relative to the project's basedir or absolute.
True
destdir directory
Directory in which to store the results. The default is the project base directory.
False
extension string
Desired file extension to be used for the targets. The default is html.
False
out file
Specifies the output name for the styled result from the NAnt.Core.Tasks.StyleTask.SrcFile attribute.
False
in file
Specifies a single XML document to be styled. Should be used with the NAnt.Core.Tasks.StyleTask.OutputFile attribute.
False
failonerror bool
Determines if task failure stops the build, or is just reported. The default is true.
False
if bool
If true then the task will be executed; otherwise, skipped. The default is true.
False
unless bool
Opposite of NAnt.Core.Task.IfDefined. If false then the task will be executed; otherwise, skipped. The default is false.
False
verbose bool
Determines whether the task should report detailed build log messages. The default is false.
False

Nested elements

<extensionobjects>

XSLT extension objects to be passed to the XSLT transformation.

Parameters

Attribute Type Description Required
assembly file
The assembly which contains the XSLT extension object.
True
typename string
The full type name of the XSLT extension object.
True
if bool
Indicates if the extension object should be added to the XSLT argument list. If true then the extension object will be added; otherwise, skipped. The default is true.
False
namespaceuri string
The namespace URI to associate with the extension object.
False
unless bool
Indicates if the extension object should not be added to the XSLT argument list. If false then the extension object will be added; otherwise, skipped. The default is false.
False

<extensionobjects>

<infiles>

Specifies a group of input files to which to apply the stylesheet.

</infiles>

<parameters>

XSLT parameters to be passed to the XSLT transformation.

Parameters

Attribute Type Description Required
name string
The name of the XSLT parameter.
True
value string
The value of the XSLT parameter.
True
if bool
Indicates if the parameter should be added to the XSLT argument list. If true then the parameter will be added; otherwise, skipped. The default is true.
False
namespaceuri string
The namespace URI to associate with the parameter.
False
unless bool
Indicates if the parameter should not be added to the XSLT argument list. If false then the parameter will be added; otherwise, skipped. The default is false.
False

<parameters>

<proxy>

The network proxy to use to access the Internet resource.

</proxy>

Examples

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

Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Tasks