newbie: Result of an Xslt transformation in XmlDatadocument

  • Thread starter Thread starter Ajw
  • Start date Start date
A

Ajw

Hi,

I would like to write the result of an Xslt Transformation to a new
XmlDataDocument.

So far I have only found examples where the result is written to disk, or to
console /response output.

Can somebody please help me with a code sniplet?

Thanks,

Albert Jan
 
Ajw said:
I would like to write the result of an Xslt Transformation to a new
XmlDataDocument.

With .NET 1.x and XslTransform you have this overload
<http://msdn.microsoft.com/library/d...emXmlXslXslTransformClassTransformTopic13.asp>
for instance which would allow you to output to a MemoryStream, then set
Position of that stream to 0 and Load into the XmlDataDocument.

Even more elegant is this overload
<http://msdn.microsoft.com/library/d...temxmlxslxsltransformclasstransformtopic6.asp>
which creates an XmlReader as the result of the Transform method so that
way you can directly call the Load method of XmlDataDocument with the
result of the Transform method as the argument.

For .NET 2.0 and XslCompiledTransform check
<http://www.xmlmvp.org/common/index.html>
for the XslReader to have a similar way. Of course the MemoryStream
would work with .NET 2.0 anyway.
 

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

Back
Top