Steven Livingstone [mailto:[EMAIL PROTECTED]] wrote:
> I dunno if this is a bug of some kind, but i would love > either the answer or solution to how to do this. > > I use an Xslt with the XslTransform class to output an Html > document straight into a XmlReader instance. > > When i try to use the ReadOuterXml() method to get all the > code in the reader i cannot - it says it is not an instance. > If i use the ReadInnerXml > () method after finding the html element then i get the title > and body tags etc... fine. > > If i use the StringWriter() class and use its ToString() > method then i can output the full html fine. > > What is going on? I have pretty much tried everything with Read(), > MoveToContent() etc etc with no success. Well... this simple test of XmlReader works as expected: <codeSnippet language="C#"> XmlReader reader = new XmlTextReader(new StringReader(@"<root><child/></root>")); reader.MoveToContent(); Debug.WriteLine(reader.ReadOuterXml()); </codeSnippet> So, I'm guessing it's something to related to the specific approach. You get the the XmlReader back from XslTransform::Transform and just call MoveToContent then ReadOuterXml right away? Is it possible to post your exact code? Thanx, Drew [ .NET MVP | weblog: http://radio.weblogs.com/0104813/ ] You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.