[Mono-bugs] [Bug 76115][Nor] New - XmlException if XslTransform returns empty document as XmlReader

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Sep 15 11:49:45 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by csaba.halasz at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76115

--- shadow/76115	2005-09-15 11:49:45.000000000 -0400
+++ shadow/76115.tmp.10057	2005-09-15 11:49:45.000000000 -0400
@@ -0,0 +1,62 @@
+Bug#: 76115
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: Csaba.Halasz at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlException if XslTransform returns empty document as XmlReader
+
+Description of Problem:
+XmlException is thrown if XslTransform results in 
+an empty document when using the overload that returns an XmlReader.
+
+Steps to reproduce the problem:
+using System;
+using System.Xml;
+using System.Xml.Xsl;
+
+class Test
+{
+        public static void Main(string[] args)
+        {
+                XmlDocument doc = new XmlDocument();
+                doc.LoadXml ("<xsl:transform
+xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0' />");
+                XslTransform xslt = new XslTransform();
+                xslt.Load(doc, null, null);
+                XmlReader Reader = xslt.Transform(doc, new
+XsltArgumentList(), new XmlUrlResolver());
+                Console.WriteLine(Reader.EOF);
+                Reader.Read();
+                Console.WriteLine(Reader.EOF);
+        }
+}
+
+Actual Results:
+False
+Unhandled Exception: System.Xml.XmlException: Document element did not
+appear.  Line 1, position 1.
+in <0x0017a> System.Xml.XmlTextReader:Read ()
+in <0x000c3> Test:Main (System.String[] args)
+
+Expected Results:
+False
+True
+
+How often does this happen? 
+Always.
+
+Additional Information:
+It might not be a bug, but it works under M$.
+Please suggest an alternative method to detect empty result,
+if you think this is the correct behaviour.


More information about the mono-bugs mailing list