torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# Friday, March 28, 2003
Fighting XslTransform
Yesterday it took me several hours to figure out how to get XslTransform work with output-escaping. I had thought, it should not be a problem to implement it based on my experiences with our intranet app. It uses .asp to get some xml from a BL Layer and transform it using the MSXML Parser and some xslt. There I can transform a DOM and get back a DOM and output-escaping is not a problem. Now moved it up to .NET XslTransform it does not work this way. Thanks to Prajakta Joshi [@microsoft.com] 's post I have learned to use a Stream as output, then read the stream back with StreamReader to get the string I need. Has that to be?
Technorati tags:
Friday, March 28, 2003 9:11:02 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
Wednesday, June 04, 2003 3:04:45 PM (W. Europe Daylight Time, UTC+02:00)
Hi Torsten,

I think it's just a trade-off -- when you output XML through the XmlWriter.WriteString() we assume you really want it to be text and not XML. On the other hand, we *could* have made disable-output-escaping simply map to XmlWriter.WriteRaw(), but that probably isn't exactly what you wanted. For example, suppose you write out something like "<foo xmlns:bar='zzz'>" -- WriteRaw isn't going to complain or realize that namespace scope has changed, which defeats the purpose of using XmlWriter (you might as well use a StreamWriter at that point).

IMO, when people use disable-output-escaping, they are really just asking for something like XmlWriter.WriteXml(), which lets you pass in XML string to be parsed and then re-written to the writer (while maintaining namespace scope, etc.) Unfortunately the writer doesn't have any such capability today and no solid plans to enable it.

Regards,
Joshua
XmlWriter PM
Comments are closed.
Navigation

Like RSS Bandit? Make a donation to help support its development and maintenance. As little as 1€ will help.

Make payments with PayPal - it's fast, free and secure!
On this page....
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll

newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Join WebHost4Life.com