"Invalid URI: The Uri scheme is too long" - now that's a peculiar message. I got it while doing some Xslt transformations. It comes out that XslCompiledTransform can't just read any xml and transform it. There are issues if Uri scheme is too long. What is too long? Can't really tell, since mine wasn't THAT long.
The following code did not work for me:
XslCompiledTransform xsl = new XslCompiledTransform(); xsl.Load("t.xsl"); XmlWriter writer = XmlWriter.Create("dest.xml"); xsl.Transform(File.ReadAllText("source.xml"), writer);
So I had to use this one:
XslCompiledTransform xsl = new XslCompiledTransform(); xsl.Load("t.xsl"); using (XmlWriter writer = XmlWriter.Create("dest.xml")) { using (XmlReader reader = XmlReader.Create("source.xml")) { xsl.Transform(reader, writer); } }
The problem is the Transform method and File.ReadAllText that returns the whole source xml string at once. XslCompiledTransform just can't handle it for some reason.
Remember Me
a@href@title, strike
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Michal Talaga
E-mail