[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

Does system.xml have any way to transofrm data with an xswl style sheet using strings like MSXML2 does?

Daniel

2/21/2006 8:08:00 PM

Does system.xml have any way to transofrm data with an xswl style sheet
using strings like MSXML2 does?

how to convert this to use System.XML so i do not depend on MSXML2 interop?

static public string XslTransform(string style, string strdata)
{
MSXML2.IXMLDOMDocument pDoc = new MSXML2.DOMDocumentClass();
pDoc.async = false;
pDoc.loadXML(strdata);
MSXML2.IXMLDOMDocument pTemplate = new MSXML2.DOMDocumentClass();
pTemplate.async = false;
pTemplate.loadXML(style);
strdata = pDoc.transformNode(pTemplate);
return strdata;
}


1 Answer

Teemu Keiski

3/10/2006 6:29:00 PM

0

Hi,

System.Xml.Xsl.XslTransform (or System.Xml.Xsl.XslCompiledTransform in .NET
2.0) sjhould provide you what you need.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice....

"Daniel" <softwareengineer98037@yahoo.com> wrote in message
news:uEgEfIyNGHA.3908@TK2MSFTNGP10.phx.gbl...
> Does system.xml have any way to transofrm data with an xswl style sheet
> using strings like MSXML2 does?
>
> how to convert this to use System.XML so i do not depend on MSXML2
> interop?
>
> static public string XslTransform(string style, string strdata)
> {
> MSXML2.IXMLDOMDocument pDoc = new MSXML2.DOMDocumentClass();
> pDoc.async = false;
> pDoc.loadXML(strdata);
> MSXML2.IXMLDOMDocument pTemplate = new MSXML2.DOMDocumentClass();
> pTemplate.async = false;
> pTemplate.loadXML(style);
> strdata = pDoc.transformNode(pTemplate);
> return strdata;
> }
>
>