XslCompiledTransform.Transform Whitespace

Came across an error when I was using XslCompiledTransfrom.  The error is

White space cannot be stripped from input documents that have already been loaded. Provide the input document as an XmlReader instead.

Mmm OK.  My VB Code was

xsl.Transform(xmlDoc, xw2)

and I modified it to

xsl.Transform(New XmlNodeReader(xmlDoc), xw2)

The xsl includes the xsl <xsl:preserve-space elements="*"/>

The white space is not stripped but whatever.

If you googled and found this I hope it helps you out.  I wish I had found it hours ago.  I like to post things in my blog that take me a while to figure out in the hopes it helps someone else.

Print | posted on Wednesday, August 20, 2008 3:45 PM