From ae4c581100644a562018d1f3b7a1a605f93256e7 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Tue, 30 Aug 2011 20:21:03 +0900 Subject: [PATCH] LineInfo on namespace nodes were missing. --- mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs | 4 ++++ mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator2.cs | 6 ++++-- mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNode2.cs | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs index aacd990b3a0..b2c5b3d0190 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs +++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs @@ -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; + } } } } diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator2.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator2.cs index c10f3213a68..3afdbb1d77a 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator2.cs +++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator2.cs @@ -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; } } diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNode2.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNode2.cs index b094972cf78..9022b187dc9 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNode2.cs +++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNode2.cs @@ -100,5 +100,7 @@ namespace Mono.Xml.XPath public int NextNamespace; public int Name; public int Namespace; + public int LineNumber; + public int LinePosition; } } -- 2.11.4.GIT