Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

how to format xml string with an xsl stylesheet

Hi, I have a string that is in an xml format <items><num>5</num><text>sometext</text></items>

I want to transform that string somewhow using my xsl document listed below and attach it to the body of an email. I was trying to use the code below but the xmldocument load does not take a string. How can i go about accomplishing this.

XmlDocument docXml = new XmlDocument();

docXml.Load(sb.ToString());

XslCompiledTransform docXsl = new XslCompiledTransform();

docXsl.Load("xslFormats.xsl");

Thanks!
[586 byte] By [clean] at [2007-11-11 8:04:30]
# 1 Re: how to format xml string with an xsl stylesheet
Not sure which library you are using but the microsoft implementation provides a method called LoadXML which takes an XML string as input into the parser.

Cheers,
Mike
marsigme at 2007-11-11 23:28:44 >