tips & tricks


Calendario
aprile 2024
lmmgvsd
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Funzione C# per lanciare una trasformazione xslt

 

public static string Transform(string xmlData, string pathXsl)

        {

            string result;

 

            //Carico l'XML in un XmlDocument

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xmlData);

 

            XslCompiledTransform xslt = new XslCompiledTransform();

            xslt.Load(pathXsl);

 

            //StringWriter(derivato da TextWriter) per scrivere su stringa  *****

            StringBuilder sb = new StringBuilder();

            StringWriter sw = new StringWriter(sb);

            xslt.Transform(doc, null, sw);

 

            return sb.ToString();

        }

 

 

Categoria: XML
giovedì, 11 set 2008 Ore. 11.20
Archivio Posts
Anno 2020

Anno 2018

Anno 2015

Anno 2013

Anno 2011

Anno 2010

Anno 2009

Anno 2008
Statistiche
  • Views Home Page: 13.288
  • Views Posts: 55.978
  • Views Gallerie: 2.837
  • n° Posts: 117
  • n° Commenti: 1
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003