193 lines
11 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Documenting T:NAnt.Core.Tasks.StyleTask-->
<head>
<meta http-equiv="Content-Language" content="en-ca" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../style.css" />
<title>&lt;style&gt; Task</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
<tr>
<td class="NavBar-Cell">
<a href="http://nant.sourceforge.net">
<b>NAnt</b>
</a>
<img alt="-&gt;" src="../images/arrow.gif" />
<a href="../index.html">Help</a>
<img alt="-&gt;" src="../images/arrow.gif" />
<a href="../tasks/index.html">Task Reference</a>
<img alt="-&gt;" src="../images/arrow.gif" /> &lt;style&gt;</td>
<td class="NavBar-Cell" align="right">
v0.91</td>
</tr>
</table>
<h1>&lt;style&gt;</h1>
<p> Processes a document via XSLT. </p>
<h3>Parameters</h3>
<div class="table">
<table>
<tr>
<th>Attribute</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
<th style="text-align: center;">Required</th>
</tr>
<tr>
<td valign="top" class="required">style</td>
<td style="text-align: center;">
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemUriClassTopic.asp">Uri</a>
</td>
<td> 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. </td>
<td style="text-align: center;">True</td>
</tr>
<tr>
<td valign="top">destdir</td>
<td style="text-align: center;">directory</td>
<td> Directory in which to store the results. The default is the project base directory. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">extension</td>
<td style="text-align: center;">string</td>
<td> Desired file extension to be used for the targets. The default is <code>html</code>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">in</td>
<td style="text-align: center;">file</td>
<td> Specifies a single XML document to be styled. Should be used with the <code>out</code> attribute. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">out</td>
<td style="text-align: center;">file</td>
<td> Specifies the output name for the styled result from the <code>in</code> attribute. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td style="text-align: center;">bool</td>
<td> Determines if task failure stops the build, or is just reported. The default is <b>true</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">if</td>
<td style="text-align: center;">bool</td>
<td> If <b>true</b> then the task will be executed; otherwise, skipped. The default is <b>true</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">unless</td>
<td style="text-align: center;">bool</td>
<td> Opposite of <code>if</code>. If <b>false</b> then the task will be executed; otherwise, skipped. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td style="text-align: center;">bool</td>
<td> Determines whether the task should report detailed build log messages. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
</table>
</div>
<h3>Nested Elements:</h3>
<!--Element-->
<h4>
<a id="infiles">
</a>
&lt;<a href="../types/fileset.html">infiles</a>&gt;
</h4>
<div class="nested-element"> Specifies a group of input files to which to apply the stylesheet. <p /></div>
<h4>
<a id="infiles">
</a>
&lt;/<a href="../types/fileset.html">infiles</a>&gt;
</h4>
<!--Collection-->
<h4>
<a id="parameters">
</a>
&lt;parameters&gt;
</h4>
<div class="nested-element"> XSLT parameters to be passed to the XSLT transformation. <h5>&lt;parameter&gt;</h5><div class="nested-element"><p> Represents an XSLT parameter. </p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">name</td><td style="text-align: center;">string</td><td> The name of the XSLT parameter. </td><td style="text-align: center;">True</td></tr><tr><td valign="top" class="required">value</td><td style="text-align: center;">string</td><td> The value of the XSLT parameter. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> Indicates if the parameter should be added to the XSLT argument list. If <b>true</b> then the parameter will be added; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">namespaceuri</td><td style="text-align: center;">string</td><td> The namespace URI to associate with the parameter. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> Indicates if the parameter should not be added to the XSLT argument list. If <b>false</b> then the parameter will be added; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div><h5>&lt;/parameter&gt;</h5></div>
<h4>&lt;/parameters&gt;</h4>
<!--Collection-->
<h4>
<a id="extensionobjects">
</a>
&lt;extensionobjects&gt;
</h4>
<div class="nested-element"> XSLT extension objects to be passed to the XSLT transformation. <h5>&lt;extensionobject&gt;</h5><div class="nested-element"><p> Represents an XSLT extension object. The object should have a default parameterless constructor and the return value should be one of the four basic XPath data types of number, string, Boolean or node set. </p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">assembly</td><td style="text-align: center;">file</td><td> The assembly which contains the XSLT extension object. </td><td style="text-align: center;">True</td></tr><tr><td valign="top" class="required">typename</td><td style="text-align: center;">string</td><td> The full type name of the XSLT extension object. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> Indicates if the extension object should be added to the XSLT argument list. If <b>true</b> then the extension object will be added; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">namespaceuri</td><td style="text-align: center;">string</td><td> The namespace URI to associate with the extension object. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> Indicates if the extension object should not be added to the XSLT argument list. If <b>false</b> then the extension object will be added; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div><h5>&lt;/extensionobject&gt;</h5></div>
<h4>&lt;/extensionobjects&gt;</h4>
<!--Element-->
<h4>
<a id="proxy">
</a>
&lt;<a href="../types/proxy.html">proxy</a>&gt;
</h4>
<div class="nested-element"> The network proxy to use to access the Internet resource. <p /></div>
<h4>
<a id="proxy">
</a>
&lt;/<a href="../types/proxy.html">proxy</a>&gt;
</h4>
<h3>Examples</h3>
<ul class="examples">
<li>
<p>Create a report in HTML.</p>
<pre class="code">
&lt;style style="report.xsl" in="data.xml" out="report.html" /&gt;
</pre>
</li>
<li>
<p>Create a report in HTML, with a param.</p>
<pre class="code">
&lt;style style="report.xsl" in="data.xml" out="report.html"&gt;
&lt;parameters&gt;
&lt;parameter name="reportType" namespaceuri="" value="Plain" /&gt;
&lt;/parameters&gt;
&lt;/style&gt;
</pre>
</li>
<li>
<p>Create a report in HTML, with a expanded param.</p>
<pre class="code">
&lt;style style="report.xsl" in="data.xml" out="report.html"&gt;
&lt;parameters&gt;
&lt;parameter name="reportType" namespaceuri="" value="${report.type}" /&gt;
&lt;/parameters&gt;
&lt;/style&gt;
</pre>
</li>
<li>
<p>Create some code based on a directory of templates.</p>
<pre class="code">
&lt;style style="CodeGenerator.xsl" extension="java"&gt;
&lt;infiles&gt;
&lt;include name="*.xml" /&gt;
&lt;/infiles&gt;
&lt;parameters&gt;
&lt;parameter name="reportType" namespaceuri="" value="Plain" if="${report.plain}" /&gt;
&lt;/parameters&gt;
&lt;style&gt;
</pre>
</li>
<li>
<p>Create a report in HTML, with an extension object.</p>
<pre class="code">
&lt;style style="report.xsl" in="data.xml" out="report.html"&gt;
&lt;extensionobjects&gt;
&lt;extensionobject namespaceuri="urn:Formatter" typename="XsltExtensionObjects.Formatter" assembly="XsltExtensionObjects.dll" /&gt;
&lt;/extensionobjects&gt;
&lt;/style&gt;
</pre>
</li>
</ul>
<h3>Requirements</h3>
<div style="margin-left: 20px;">
<b>Assembly:</b> NAnt.Core (0.91.4312.0)
</div>
</body>
</html>