Implementation and tests for XmlAttributeCollection.RemoveAll and XmlElement.RemoveAl...
[mono.git] / mcs / class / System.XML / System.Xml / XmlTextReader.cs
index 91611af2ee9d2ac6254437660226abf26b9ee56b..178d9a06d3ceabfcf9904a8d7564d909c22e0f26 100644 (file)
@@ -210,16 +210,14 @@ namespace System.Xml
                        get { return GetAttribute (localName, namespaceName); }
                }
 
-               [MonoTODO]
                public int LineNumber
                {
-                       get { throw new NotImplementedException (); }
+                       get { return line; }
                }
 
-               [MonoTODO]
                public int LinePosition
                {
-                       get { throw new NotImplementedException (); }
+                       get { return column; }
                }
 
                public override string LocalName
@@ -613,6 +611,8 @@ namespace System.Xml
                private StringBuilder xmlBuffer; // This is for Read(Inner|Outer)Xml
                private StringBuilder currentTag; // A buffer for ReadContent for ReadOuterXml
                private bool saveToXmlBuffer;
+               private int line;
+               private int column;
 
                private void Init ()
                {
@@ -728,6 +728,12 @@ namespace System.Xml
                private int ReadChar ()
                {
                        int ch = reader.Read ();
+                       if (ch == '\n') {
+                               line++;
+                               column = 1;
+                       } else {
+                               column++;
+                       }
                        if (saveToXmlBuffer) {
                                xmlBuffer.Append ((char) ch);
                        }