+2005-09-10 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Compiler.cs : (Compile) check children only when it is the document
+ element. Fixed bug #76046.
+
2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
* ScriptCompilerInfo.cs : It should not be "#line" when the source is
this.res = new XmlUrlResolver ();
this.evidence = evidence;
- if (!nav.MoveToFirstChild ())
+ // reject empty document.
+ if (nav.NodeType == XPathNodeType.Root && !nav.MoveToFirstChild ())
throw new XsltCompileException ("Stylesheet root element must be either \"stylesheet\" or \"transform\" or any literal element.", null, nav);
outputs [""] = new XslOutput ("");
+2005-09-10 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XslTransformTests.cs : added testcase for bug #76046.
+
2005-08-31 Sebastien Pouliot <sebastien@ximian.com>
* XsltArgumentListCas.cs: New. CAS unit tests for AddExtensionObject.
XPathDocument xmlDocument = new XPathDocument (new StringReader (xmlText));
transform.Transform (xmlDocument, null, TextWriter.Null);
}
+
+ // bug #76046
+ [Test]
+ public void LoadStyleFromNonRoot ()
+ {
+ XmlDocument doc = new XmlDocument ();
+ XslTransform xslt = new XslTransform ();
+ doc.LoadXml ("<root><dummy /><xsl:transform xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0' /></root>");
+ XmlNode node = doc.ChildNodes [0].ChildNodes [1];
+ xslt.Load (node, null, null);
+ }
}
}