when switching from the old "XslTransform " to "XslCompiledTransform"
I notice a difference in the handling of whitespace. I need to transform
a XML file which contain tabs (\t), and which remain untouched when I
use XslTransform to do the transformation.
But after switching to XslCompiledTransform the tabs are transformed to
a single space in the result file, which leads to problems later on the
the program.
what I found was:
http://blogs.msdn.com/xmlteam/articl...Transform.aspx
which states:
"To load the cache, XslCompiledTransform uses XmlReader to read the
input document. At this time, XslCompiledTransform applies whitespace
stripping rules."
So What I tried:
- added a <xsl:preserve-space elements="_element_name"/> to the
stylesheet. I tried various Element names, but this didn't seem to make
any difference (or I made a mistake?)
- tried using a XmlReader with "IgnoreWhitespace":
XmlReaderSettings rs = new XmlReaderSettings();
rs.IgnoreWhitespace = false;
reader = XmlReader.Create(filePath, rs);
m_XslTransform.Transform(reader, new System.Xml.Xsl.XsltArgumentList(), ms);
Both of which resultet in the same: all tabs are gone.
Is there something I can do, or do I have to stay with XslTransform?
Thanks,
Ecki