XslCompiledTransform

S

Sunday Oke

Hi folks

I have this code which basically transforms a recordset retrieved from a
oracle database. With the XslTransform class being deprecated I have
tried to use the XslCompiledTransform class instead to get the same
result, but to no avail. Please help

XmlDataDocument xmlDoc = new XmlDataDocument(dsExport); //dsExport is my
dataset

XslTransform xslTran = new XslTransform();
xslTran.Load(new XmlTextReader(stream), null, null);
System.IO.StringWriter sw = new System.IO.StringWriter();
xslTran.Transform(xmlDoc, null, sw, null);
 
M

Martin Honnen

Sunday Oke wrote:

I have this code which basically transforms a recordset retrieved from a
oracle database. With the XslTransform class being deprecated I have
tried to use the XslCompiledTransform class instead to get the same
result, but to no avail. Please help

XmlDataDocument xmlDoc = new XmlDataDocument(dsExport); //dsExport is my
dataset

XslTransform xslTran = new XslTransform();
xslTran.Load(new XmlTextReader(stream), null, null);
System.IO.StringWriter sw = new System.IO.StringWriter();
xslTran.Transform(xmlDoc, null, sw, null);

XslCompiledTransform xsltProcessor = new XslCompiledTransform();
xsltProcessor.Load(new XPathDocument(stream));
StringWriter sw = new StringWriter();
xsltProcessor.Transform(xmlDoc, null, sw);
string result = sw.ToString();
should do. If your stylesheet imports and/or includes other stylesheet
modules or if you want to use the XSLT document function then you might
need some additional settings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top