RE: [xsl] Re: opinions on ease of use with EXSLT for .NET

Subject: RE: [xsl] Re: opinions on ease of use with EXSLT for .NET
From: kakridge@xxxxxxxxxxxxx
Date: Thu, 18 Dec 2003 20:51:02 -0500

I really appreciate your feedback on this.  I'm still pretty new to
XSLT, so you are correct; I do not have a solid understanding of a lot
of the technologies available.  I appreciate the information about
nxslt.  I am going to integrate that into Xselerator for testing. 


Kenny Akridge

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Dimitre
Sent: Thursday, December 18, 2003 2:35 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Re: opinions on ease of use with EXSLT for .NET

<kakridge@xxxxxxxxxxxxx> wrote in message
> How difficult is it to use EXSLT for .NET.  Right now, I have a lot of
> code in place already for handling translations.  This isn't like the
> non-.NET EXSLT where you can just import a template/function?

You do not understand what EXSLT really is. Its idea is to be
implemented by
the vendors of XSLT processors (as it is done in the majority of cases
e.g. Saxon, Xalan, JD, xsltProc, etc...) or by third parties, so that
programmer only has to declare the necessary EXSLT namespace and use the
EXSLT functions in XPath expressions.

Recently EXSLT has been implemented for .Net xsltTransform and partially
(the Common and Sets modules) for MSXML4.

No importing of templates is necessary and in fact nothing should be

The xslt stylesheets provided at the EXSLT site are to be used only with
XSLT processors, for which there is no other known implementation. Often
these stylesheets do not implement all functions or implement them with
limited capabilities.

> Do I have
> to rebuild some of the classes that handle my transformations?

You just install EXSLT.Net.Read the MSDN articles on EXSLT:

"EXSLT: Enhancing the Power of XSLT"


"EXSLT Meets XPath"

 To use EXSLT.Net one typically writes the following code (which is
identical to the code when EXSLT is not used). This code snippet is
from the first article above:

using System.IO;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.Xml;
using Exslt;
using System;

public class Test{

  private const String filename = "test.xml";
  private const String stylesheet = "test.xsl";

  public static void Main(string[] args){


      //Create the XslTransform and load the stylesheet.
      ExsltTransform exslt = new ExsltTransform();

      //Load the XML data file.
      XPathDocument doc = new XPathDocument(filename);

      //Create an XsltArgumentList.
      XsltArgumentList xslArg = new XsltArgumentList();

      //Create an XmlTextWriter to output to the console.
      XmlTextWriter writer = new XmlTextWriter(Console.Out);

      //Transform the file.
      exslt.Transform(doc, xslArg, writer);

     }catch(Exception e){
      Console.WriteLine("UNEXPECTED ERROR: " + e.ToString());

While just testing the transformation one may use tools like XSelerator
XML SPY and integrate the Nxslt.exe commad-line utility -- then running
xsltTransform is just a one-click job.

Hope this helped.

Dimitre Novatchev,
FXSL developer -- the home of FXSL

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread