Just a little For Your Information:
If you get the following XSLT error: <I>An unexpected end of file parsing NAME has occurred</I>, it may be because your XML file header declares the encoding as UTF-8 (or whatever), thusly: <?xml version=”1.0″ encoding=”utf-8″?>, whilst your .net XSLT processing code is expecting a different encoding, thusly:
byte[] buffer = System.Text.Encoding.Unicode.GetBytes(XML);
memStream.Write(buffer, 0, buffer.Length);
memStream.Seek(0, System.IO.SeekOrigin.Begin);
System.Xml.XPath.XPathDocument xpathDoc = new System.Xml.XPath.XPathDocument(memStream);
Notice that the XML encoding is declared as UTF-8, whilst the .Net code is expecting Unicode (a typo). The XSLT processor doesn’t like this. Just a little something to watch out for that took me a few ticks to solve.
This is .Net 1.1 code by the way. It’s much easier to do XSLT transforms in .Net 2.0 because there’s no need to create a temporary stream to hold XML.