2005-03-03 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 3 Mar 2005 08:19:31 +0000 (08:19 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 3 Mar 2005 08:19:31 +0000 (08:19 -0000)
* XslElement.cs : reject incorrectly qualified name attribute.

svn path=/trunk/mcs/; revision=41385

mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslElement.cs

index ad458e97018ed5eac806dcae6a4db3675c8bc583..12a6aeb9a26129d11fef744fb4db67d46ccd6da3 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-03  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XslElement.cs : reject incorrectly qualified name attribute.
+
 2005-03-02  Atsushi Enomoto  <atsushi@ximian.com>
 
        * XslElement.cs : name should be splitted regardless of "namespace"
index 3aaf97ccc5eb623eb8c268981c8494106d37bdfb..87121e958a393b22958ecf60830096f07a77cf28 100644 (file)
@@ -61,9 +61,8 @@ namespace Mono.Xml.Xsl.Operations {
                                if (colonAt == 0)
                                        throw new XsltCompileException ("Invalid name attribute.", null, c.Input);
                                calcPrefix = colonAt < 0 ? String.Empty : calcName.Substring (0, colonAt);
-                               calcName = colonAt < 0 ? calcName : calcName.Substring (colonAt + 1, calcName.Length - colonAt - 1);
-                               if (ns == null)
-                                       calcNs = c.Input.GetNamespace (calcPrefix);
+                               if (colonAt > 0)
+                                       calcName = calcName.Substring (colonAt + 1);
 
                                try {
                                        XmlConvert.VerifyNCName (calcName);
@@ -72,6 +71,12 @@ namespace Mono.Xml.Xsl.Operations {
                                } catch (XmlException ex) {
                                        throw new XsltCompileException ("Invalid name attribute.", ex, c.Input);
                                }
+
+                               if (ns == null) {
+                                       calcNs = c.Input.GetNamespace (calcPrefix);
+                                       if (calcPrefix != String.Empty && calcNs == String.Empty)
+                                               throw new XsltCompileException ("Invalid name attribute.", null, c.Input);
+                               }
                        } else if (ns != null)
                                calcNs = XslAvt.AttemptPreCalc (ref ns);