Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Transforming XML with XSL to String

Reply
Thread Tools

Transforming XML with XSL to String

 
 
Krista Lemieux
Guest
Posts: n/a
 
      08-10-2004
Hello,

I am trying to transform XML with XSL to a string
in .NET. Currently I am using XSLTransform class, but all
the Transform() methods write to a file. How can I
Transform it straight to a string without writing to a
file and then reading back from the file (not to lose out
on performance).

Thank you for your help in advance.

Merci,
Krista Lemieux
 
Reply With Quote
 
 
 
 
Steve Flitcroft
Guest
Posts: n/a
 
      08-10-2004
Try something like this, the StringWriter is passed into the transform method and returns the transformed xml as a string

Dim xslt As XslTransform

Dim writer As New System.IO.StringWriter

Dim rdr As New IO.StringReader(xml)

Dim xmlDoc As New xml.XPath.XPathDocument(rdr)

xslt.Load(YourXSLTFile)

xslt.Transform(xmlDoc.CreateNavigator, xslArg, writer, Nothing)

Return writer.ToString



"Krista Lemieux" <(E-Mail Removed)> wrote in message news:334c01c47edf$5260aa10$(E-Mail Removed)...
> Hello,
>
> I am trying to transform XML with XSL to a string
> in .NET. Currently I am using XSLTransform class, but all
> the Transform() methods write to a file. How can I
> Transform it straight to a string without writing to a
> file and then reading back from the file (not to lose out
> on performance).
>
> Thank you for your help in advance.
>
> Merci,
> Krista Lemieux

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transforming an XML with XSL. Encoding problems OKI XML 0 06-14-2004 02:07 PM
Transforming an XML with XSL. Encoding problems OKI XML 1 06-14-2004 12:12 PM
Transforming XML To Binary using XSL? Xamalaek XML 1 05-19-2004 05:47 AM
Transforming XML To Binary Format using XSL? Xamalaek XML 0 05-14-2004 03:53 PM
Transforming xml with server controls with xsl dwhitford ASP .Net 0 05-14-2004 02:44 PM



Advertisments