LineInfo on namespace nodes were missing.
authorAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Tue, 30 Aug 2011 11:21:03 +0000 (20:21 +0900)
committerAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Tue, 30 Aug 2011 11:21:03 +0000 (20:21 +0900)
mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs
mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator2.cs
mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNode2.cs

index aacd990b3a09a7e8e6802fd848fa6ed5414dbf23..b2c5b3d01904432fafa92a5465a7eed382d3b25d 100644 (file)
@@ -578,6 +578,10 @@ namespace Mono.Xml.XPath
                        namespaces [nsIndex].Name = name;
                        namespaces [nsIndex].Namespace = ns;
                        namespaces [nsIndex].NextNamespace = nextNs;
+                       if (lineInfo != null && lineInfo.HasLineInfo ()) {
+                               namespaces [nsIndex].LineNumber = lineInfo.LineNumber;
+                               namespaces [nsIndex].LinePosition = lineInfo.LinePosition;
+                       }
                }
        }
 }
index c10f3213a685108a85f2a8d41ee7bed64e7aebba..3afdbb1d77aafbc7694a6cb5e373cd51a52d9f74 100644 (file)
@@ -118,14 +118,16 @@ namespace Mono.Xml.XPath
                int IXmlLineInfo.LineNumber {
                        get {
                                return currentIsAttr ? attributes [currentAttr].LineNumber :
-                                       nodes [currentNode].LineNumber;
+                                       currentIsNode ? nodes [currentNode].LineNumber :
+                                       namespaces [currentNs].LineNumber;
                        }
                }
 
                int IXmlLineInfo.LinePosition {
                        get {
                                return currentIsAttr ? attributes [currentAttr].LinePosition :
-                                       nodes [currentNode].LinePosition;
+                                       currentIsNode ? nodes [currentNode].LinePosition :
+                                       namespaces [currentNs].LinePosition;
                        }
                }
 
index b094972cf78647eda81743ed4848d955b1d57328..9022b187dc9d3d994bb0edadd16c21076a141d4c 100644 (file)
@@ -100,5 +100,7 @@ namespace Mono.Xml.XPath
                public int NextNamespace;
                public int Name;
                public int Namespace;
+               public int LineNumber;
+               public int LinePosition;
        }
 }