I just uploaded nxslt v2.1 release. In addition to the nxslt.exe command line tool it now also includes nxslt task implementation for NAnt and MSBuild.
Why another XSLT task? Because existing ones suck. NAnt includes standard "style" task, but it uses obsolete slow and buggy XslTransform engine to perform transformations. MSBuild doesn't include XSLT task at all, while the Xslt task from the MSBuild Community Tasks Project is broken. Not no mention these tasks are barebone ones. If you need a better XSLT task for NAnt or MSBuild - nxslt task is for you.
Here is some highlights on this new nxslt task.
nxslt task is a free feature-rich task for NAnt and MSBuild that allows to perform XSL Transformations (XSLT) using .NET Framework 2.0 XSLT 1.0 implementation - XslCompiledTransform class. nxslt task supports plenty of advanced features:
- XML Base, XInclude, XPointer
- Embedded stylesheets
- <?xml-stylesheet?> processing instruction
- Multiple output documents via exsl:document extension element
- Custom URI resolving
- Custom extension functions
- 70+ EXSLT and EXSLT.NET extension functions
- Credentials to access XML documents and XSLT stylesheets
- Pretty printing
- Batch processing
nxslt and nxslt task are free tools under BSD license. Download here.
Btw, besides transforming XML documents nxslt task can also be used for pretty printing or resolving XIncludes. I'll post on this later.
Hello Oleg,
I am a user of nant/nxslt and I want to design a multiple output XSLT. So I naturally found your page and I wanted to go to the link "nxslt task implementation for NAnt and MSBuild", but the site xmllab.net seems to be down. Any idea whether this is permanent ? Because I cannot find any documentation about nxslt...
Thank you,
Julien
Derek, exsl:document can do this. Its href attribute accepts any XPath expression:
<exsl:document href="{$outputName}">
...
</exsl:document>
Hi Oleg,
I'm a application designer and have found your blogs, postings, etc in pretty much all of my searches on a particular item. Seems like a pretty easy request but I'm not finding an easy answer. Thought I'd post it by you for your comments....
We have an application requirement where we would like to decorate the name of a transformed output file, using text and XPath references. (Using .NET 2.0) Am familiar with the xsl:0utput element but it only seems to have a hardname value.
We do see xsl:result-document in XSLT 2.0 but don't think that this is supported in .NET 2.0 transform engine.
Also have looked at the parms list in nxslt2 but don't see a methodology to dynamically write output file name.
Have also noted the work in exsl:document but that's where I stopped to see if I was missing something much easier.
Any thoughts?
Cheers,
Derek Kellock