Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Xslt Transform using Microsoft.GotDotNet.ExsltTranform in .NET 2.0

Reply
 
Old 11-26-2008   #1 (permalink)
Mike


 
 

Xslt Transform using Microsoft.GotDotNet.ExsltTranform in .NET 2.0

Hi,

I have a command line project which I am using to transform xml from one
format to another, making use of the Microsoft.GotDotNet.ExsltTranform class.
This application was originally developed and run in a .NET 1.0 environment
but I have recenlty been required to port this over to .NET 2.0 in order to
allow it to be run on machines which don not have version 1.0 of the
framework.

When this application was ported the Transform method on the
Microsoft.GotDotNet.ExsltTransform class began working in an unexpected
manner:

Where the class previously replaced the parameter ‘currentdate’ in the
stylesheet with a date time parameter (e.g. “2008-05-06T12:57:09”), it is now
simply tranforming currentdate to “T”. I have included the method call below:

if (options.ExsltLibPath == null)
{
xslt.Transform(doc, options.XslArgList, fs);
}

Where:
- ‘doc’ is and instance of ‘System.Xml.XPath.XpathDocument’
- ‘options.XslArgList’ is and instance of ‘System.Xml.Xsl.XsltArgumentList’
containing one parameter named ‘currentdate’ with the value
'2008-10-03_10:24:02’.
- ‘fs’ is an instance of ‘System.IO.FileStream’ to write the output file.


........Below is the method called within the
Microsoft.GotDotNet.ExsltTranform class......

/// <summary> Transforms the XML data in the IXPathNavigable using the
specified args and outputs the result to a Stream</summary>
public void Transform(IXPathNavigable ixn, XsltArgumentList arglist,
Stream stream)
{
if (_multiOutput)
{
this.xslTransform.Transform(
ixn,
this.AddExsltExtensionObjects(arglist),
new MultiXmlTextWriter(stream, Encoding.UTF8)
);
}
else
{
this.xslTransform.Transform(ixn,
this.AddExsltExtensionObjects(arglist), stream);
}
}





My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Removing XSLT use from .Net 1.1 windows service .NET General
Merge 2 XML Documents using XSLT Transform .NET General
MAML XSLT and XSD? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46