dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System.Xml XmlAttribute.cs,1.1,1.2 Xm


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Xml XmlAttribute.cs,1.1,1.2 XmlAttributeCollection.cs,1.1,1.2 XmlNode.cs,1.6,1.7 XmlTextReader.cs,1.7,1.8
Date: Mon, 02 Dec 2002 22:48:31 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Xml
In directory subversions:/tmp/cvs-serv19431/System.Xml

Modified Files:
        XmlAttribute.cs XmlAttributeCollection.cs XmlNode.cs 
        XmlTextReader.cs 
Log Message:


Continue implementing System.Xml.


Index: XmlAttribute.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/XmlAttribute.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** XmlAttribute.cs     27 Jul 2002 09:42:59 -0000      1.1
--- XmlAttribute.cs     3 Dec 2002 03:48:29 -0000       1.2
***************
*** 37,40 ****
--- 37,42 ----
        private String ns;
        private String name;
+       internal char quoteChar;
+       internal XmlAttribute next;
  
        // Constructor.
***************
*** 55,58 ****
--- 57,70 ----
                                        name = localName;
                                        prefix = String.Empty;
+                               }
+                               quoteChar = '"';
+                       }
+ 
+       // Get the attribute collection from the parent node.
+       internal override XmlAttributeCollection AttributesInternal
+                       {
+                               get
+                               {
+                                       return ParentNode.AttributesInternal;
                                }
                        }

Index: XmlAttributeCollection.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/XmlAttributeCollection.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** XmlAttributeCollection.cs   27 Jul 2002 09:42:59 -0000      1.1
--- XmlAttributeCollection.cs   3 Dec 2002 03:48:29 -0000       1.2
***************
*** 36,39 ****
--- 36,43 ----
        public int Count { get { return 0; /* TODO */ } }
  
+       public XmlAttribute this[int i] { get { return null; } }
+       public XmlAttribute this[String name] { get { return null; } }
+       public XmlAttribute this[String name, String ns] { get { return null; } 
}
+ 
  }; // class XmlAttributeCollection
  

Index: XmlNode.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/XmlNode.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** XmlNode.cs  2 Dec 2002 23:55:43 -0000       1.6
--- XmlNode.cs  3 Dec 2002 03:48:29 -0000       1.7
***************
*** 36,39 ****
--- 36,40 ----
        internal XmlNode  parent;
        internal NodeList list;
+       internal int depth;
  
        // Constructor.  Only accessible to internal subclasses.
***************
*** 42,45 ****
--- 43,54 ----
                                this.parent = parent;
                                this.list = null;               // Created on 
demand to save memory.
+                               if(parent != null)
+                               {
+                                       depth = parent.depth + 1;
+                               }
+                               else
+                               {
+                                       depth = 1;
+                               }
                        }
  
***************
*** 53,56 ****
--- 62,75 ----
                        }
  
+       // Get the attribute collection for node types that don't override
+       // "Attributes" according to the specification.
+       internal virtual XmlAttributeCollection AttributesInternal
+                       {
+                               get
+                               {
+                                       return Attributes;
+                               }
+                       }
+ 
        // Get the base URI for this document.
        public virtual String BaseURI
***************
*** 269,273 ****
                                get
                                {
!                                       return null;
                                }
                                set
--- 288,292 ----
                                get
                                {
!                                       return String.Empty;
                                }
                                set

Index: XmlTextReader.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/XmlTextReader.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** XmlTextReader.cs    2 Dec 2002 23:55:43 -0000       1.7
--- XmlTextReader.cs    3 Dec 2002 03:48:29 -0000       1.8
***************
*** 46,49 ****
--- 46,50 ----
        private String baseURI;
        private Encoding encoding;
+       private XmlNode currentNode;
  
        // Constructors.
***************
*** 72,75 ****
--- 73,77 ----
                                baseURI = String.Empty;
                                encoding = null;
+                               currentNode = null;
                        }
        public XmlTextReader(Stream input)
***************
*** 208,231 ****
  
        // Returns the value of an attribute with a specific index.
-       [TODO]
        public override String GetAttribute(int i)
                        {
!                               // TODO
!                               return null;
                        }
  
        // Returns the value of an attribute with a specific name.
-       [TODO]
        public override String GetAttribute(String name, String namespaceURI)
                        {
!                               // TODO
                                return null;
                        }
  
        // Returns the value of an attribute with a specific qualified name.
-       [TODO]
        public override String GetAttribute(String name)
                        {
!                               // TODO
                                return null;
                        }
--- 210,274 ----
  
        // Returns the value of an attribute with a specific index.
        public override String GetAttribute(int i)
                        {
!                               XmlAttributeCollection attributes;
!                               if(currentNode == null)
!                               {
!                                       attributes = null;
!                               }
!                               else
!                               {
!                                       attributes = 
currentNode.AttributesInternal;
!                               }
!                               if(attributes != null)
!                               {
!                                       if(i >= 0 && i < attributes.Count)
!                                       {
!                                               return attributes[i].Value;
!                                       }
!                               }
!                               throw new ArgumentOutOfRangeException
!                                       ("i", S._("Xml_InvalidAttributeIndex"));
                        }
  
        // Returns the value of an attribute with a specific name.
        public override String GetAttribute(String name, String namespaceURI)
                        {
!                               XmlAttributeCollection attributes;
!                               XmlAttribute attribute;
!                               if(currentNode == null)
!                               {
!                                       return null;
!                               }
!                               attributes = currentNode.AttributesInternal;
!                               if(attributes != null)
!                               {
!                                       attribute = attributes[name, 
namespaceURI];
!                                       if(attribute != null)
!                                       {
!                                               return attribute.Value;
!                                       }
!                               }
                                return null;
                        }
  
        // Returns the value of an attribute with a specific qualified name.
        public override String GetAttribute(String name)
                        {
!                               XmlAttributeCollection attributes;
!                               XmlAttribute attribute;
!                               if(currentNode == null)
!                               {
!                                       return null;
!                               }
!                               attributes = currentNode.AttributesInternal;
!                               if(attributes != null)
!                               {
!                                       attribute = attributes[name];
!                                       if(attribute != null)
!                                       {
!                                               return attribute.Value;
!                                       }
!                               }
                                return null;
                        }
***************
*** 246,293 ****
  
        // Move the current position to a particular attribute.
-       [TODO]
        public override void MoveToAttribute(int i)
                        {
!                               // TODO
                        }
  
        // Move the current position to an attribute with a particular name.
-       [TODO]
        public override bool MoveToAttribute(String name, String ns)
                        {
!                               // TODO
                                return false;
                        }
  
        // Move the current position to an attribute with a qualified name.
-       [TODO]
        public override bool MoveToAttribute(String name)
                        {
!                               // TODO
                                return false;
                        }
  
        // Move to the element that owns the current attribute.
-       [TODO]
        public override bool MoveToElement()
                        {
!                               // TODO
!                               return false;
                        }
  
        // Move to the first attribute owned by the current element.
-       [TODO]
        public override bool MoveToFirstAttribute()
                        {
!                               // TODO
                                return false;
                        }
  
        // Move to the next attribute owned by the current element.
-       [TODO]
        public override bool MoveToNextAttribute()
                        {
!                               // TODO
!                               return false;
                        }
  
--- 289,411 ----
  
        // Move the current position to a particular attribute.
        public override void MoveToAttribute(int i)
                        {
!                               XmlAttributeCollection attributes;
!                               if(currentNode == null)
!                               {
!                                       attributes = null;
!                               }
!                               else
!                               {
!                                       attributes = 
currentNode.AttributesInternal;
!                               }
!                               if(attributes != null)
!                               {
!                                       if(i >= 0 && i < attributes.Count)
!                                       {
!                                               currentNode = attributes[i];
!                                               return;
!                                       }
!                               }
!                               throw new ArgumentOutOfRangeException
!                                       ("i", S._("Xml_InvalidAttributeIndex"));
                        }
  
        // Move the current position to an attribute with a particular name.
        public override bool MoveToAttribute(String name, String ns)
                        {
!                               XmlAttributeCollection attributes;
!                               XmlAttribute attribute;
!                               if(currentNode == null)
!                               {
!                                       return false;
!                               }
!                               attributes = currentNode.AttributesInternal;
!                               if(attributes != null)
!                               {
!                                       attribute = attributes[name, ns];
!                                       if(attribute != null)
!                                       {
!                                               currentNode = attribute;
!                                               return true;
!                                       }
!                               }
                                return false;
                        }
  
        // Move the current position to an attribute with a qualified name.
        public override bool MoveToAttribute(String name)
                        {
!                               XmlAttributeCollection attributes;
!                               XmlAttribute attribute;
!                               if(currentNode == null)
!                               {
!                                       return false;
!                               }
!                               attributes = currentNode.AttributesInternal;
!                               if(attributes != null)
!                               {
!                                       attribute = attributes[name];
!                                       if(attribute != null)
!                                       {
!                                               currentNode = attribute;
!                                               return true;
!                                       }
!                               }
                                return false;
                        }
  
        // Move to the element that owns the current attribute.
        public override bool MoveToElement()
                        {
!                               XmlAttribute attr = (currentNode as 
XmlAttribute);
!                               if(attr != null)
!                               {
!                                       currentNode = attr.parent;
!                                       return true;
!                               }
!                               else
!                               {
!                                       return false;
!                               }
                        }
  
        // Move to the first attribute owned by the current element.
        public override bool MoveToFirstAttribute()
                        {
!                               XmlAttributeCollection attributes;
!                               if(currentNode != null)
!                               {
!                                       attributes = 
currentNode.AttributesInternal;
!                                       if(attributes != null && 
attributes.Count > 0)
!                                       {
!                                               currentNode = attributes[0];
!                                               return true;
!                                       }
!                               }
                                return false;
                        }
  
        // Move to the next attribute owned by the current element.
        public override bool MoveToNextAttribute()
                        {
!                               XmlAttribute attr = (currentNode as 
XmlAttribute);
!                               if(attr != null)
!                               {
!                                       attr = attr.next;
!                                       if(attr != null)
!                                       {
!                                               currentNode = attr;
!                                               return true;
!                                       }
!                                       else
!                                       {
!                                               return false;
!                                       }
!                               }
!                               else
!                               {
!                                       return MoveToFirstAttribute();
!                               }
                        }
  
***************
*** 371,381 ****
  
        // Get the number of attributes on the current node.
-       [TODO]
        public override int AttributeCount
                        {
                                get
                                {
!                                       // TODO
!                                       return 0;
                                }
                        }
--- 489,505 ----
  
        // Get the number of attributes on the current node.
        public override int AttributeCount
                        {
                                get
                                {
!                                       XmlElement element = (currentNode as 
XmlElement);
!                                       if(element != null)
!                                       {
!                                               return element.Attributes.Count;
!                                       }
!                                       else
!                                       {
!                                               return 0;
!                                       }
                                }
                        }
***************
*** 391,412 ****
  
        // Get the depth of the current node.
-       [TODO]
        public override int Depth
                        {
                                get
                                {
!                                       // TODO
!                                       return 0;
                                }
                        }
  
        // Determine if we have reached the end of the input stream.
-       [TODO]
        public override bool EOF
                        {
                                get
                                {
!                                       // TODO
!                                       return false;
                                }
                        }
--- 515,539 ----
  
        // Get the depth of the current node.
        public override int Depth
                        {
                                get
                                {
!                                       if(currentNode != null)
!                                       {
!                                               return currentNode.depth;
!                                       }
!                                       else
!                                       {
!                                               return 0;
!                                       }
                                }
                        }
  
        // Determine if we have reached the end of the input stream.
        public override bool EOF
                        {
                                get
                                {
!                                       return (readState == 
ReadState.EndOfFile);
                                }
                        }
***************
*** 429,438 ****
  
        // Determine if the current node can have an associated text value.
-       [TODO]
        public override bool HasValue
                        {
                                get
                                {
!                                       // TODO
                                        return false;
                                }
--- 556,577 ----
  
        // Determine if the current node can have an associated text value.
        public override bool HasValue
                        {
                                get
                                {
!                                       switch(NodeType)
!                                       {
!                                               case XmlNodeType.Attribute:
!                                               case XmlNodeType.CDATA:
!                                               case XmlNodeType.Comment:
!                                               case XmlNodeType.DocumentType:
!                                               case 
XmlNodeType.ProcessingInstruction:
!                                               case 
XmlNodeType.SignificantWhitespace:
!                                               case XmlNodeType.Text:
!                                               case XmlNodeType.Whitespace:
!                                               case XmlNodeType.XmlDeclaration:
!                                                       return true;
!                                               default: break;
!                                       }
                                        return false;
                                }
***************
*** 440,461 ****
  
        // Determine if the current node's value was generated from a DTD 
default.
-       [TODO]
        public override bool IsDefault
                        {
                                get
                                {
!                                       // TODO
!                                       return false;
                                }
                        }
  
        // Determine if the current node is an empty element.
-       [TODO]
        public override bool IsEmptyElement
                        {
                                get
                                {
!                                       // TODO
!                                       return false;
                                }
                        }
--- 579,612 ----
  
        // Determine if the current node's value was generated from a DTD 
default.
        public override bool IsDefault
                        {
                                get
                                {
!                                       XmlAttribute attr = (currentNode as 
XmlAttribute);
!                                       if(attr != null)
!                                       {
!                                               return !(attr.Specified);
!                                       }
!                                       else
!                                       {
!                                               return false;
!                                       }
                                }
                        }
  
        // Determine if the current node is an empty element.
        public override bool IsEmptyElement
                        {
                                get
                                {
!                                       XmlElement element = (currentNode as 
XmlElement);
!                                       if(element != null)
!                                       {
!                                               return element.IsEmpty;
!                                       }
!                                       else
!                                       {
!                                               return false;
!                                       }
                                }
                        }
***************
*** 515,536 ****
  
        // Get the local name of the current node.
-       [TODO]
        public override String LocalName
                        {
                                get
                                {
!                                       // TODO
!                                       return null;
                                }
                        }
  
        // Get the fully-qualified name of the current node.
-       [TODO]
        public override String Name
                        {
                                get
                                {
!                                       // TODO
!                                       return null;
                                }
                        }
--- 666,697 ----
  
        // Get the local name of the current node.
        public override String LocalName
                        {
                                get
                                {
!                                       if(currentNode != null)
!                                       {
!                                               return currentNode.LocalName;
!                                       }
!                                       else
!                                       {
!                                               return String.Empty;
!                                       }
                                }
                        }
  
        // Get the fully-qualified name of the current node.
        public override String Name
                        {
                                get
                                {
!                                       if(currentNode != null)
!                                       {
!                                               return currentNode.Name;
!                                       }
!                                       else
!                                       {
!                                               return String.Empty;
!                                       }
                                }
                        }
***************
*** 546,556 ****
  
        // Get the namespace URI associated with the current node.
-       [TODO]
        public override String NamespaceURI
                        {
                                get
                                {
!                                       // TODO
!                                       return null;
                                }
                        }
--- 707,722 ----
  
        // Get the namespace URI associated with the current node.
        public override String NamespaceURI
                        {
                                get
                                {
!                                       if(currentNode != null)
!                                       {
!                                               return currentNode.NamespaceURI;
!                                       }
!                                       else
!                                       {
!                                               return String.Empty;
!                                       }
                                }
                        }
***************
*** 593,625 ****
  
        // Get the type of the current node.
-       [TODO]
        public override XmlNodeType NodeType
                        {
                                get
                                {
!                                       // TODO
!                                       return XmlNodeType.None;
                                }
                        }
  
        // Get the namespace prefix associated with the current node.
-       [TODO]
        public override String Prefix
                        {
                                get
                                {
!                                       // TODO
!                                       return null;
                                }
                        }
  
        // Get the quote character that was used to enclose an attribute value.
-       [TODO]
        public override char QuoteChar
                        {
                                get
                                {
!                                       // TODO
!                                       return '"';
                                }
                        }
--- 759,807 ----
  
        // Get the type of the current node.
        public override XmlNodeType NodeType
                        {
                                get
                                {
!                                       if(currentNode != null)
!                                       {
!                                               return currentNode.NodeType;
!                                       }
!                                       else
!                                       {
!                                               return XmlNodeType.None;
!                                       }
                                }
                        }
  
        // Get the namespace prefix associated with the current node.
        public override String Prefix
                        {
                                get
                                {
!                                       if(currentNode != null)
!                                       {
!                                               return currentNode.Prefix;
!                                       }
!                                       else
!                                       {
!                                               return String.Empty;
!                                       }
                                }
                        }
  
        // Get the quote character that was used to enclose an attribute value.
        public override char QuoteChar
                        {
                                get
                                {
!                                       XmlAttribute attr = (currentNode as 
XmlAttribute);
!                                       if(attr != null)
!                                       {
!                                               return attr.quoteChar;
!                                       }
!                                       else
!                                       {
!                                               return '"';
!                                       }
                                }
                        }
***************
*** 635,645 ****
  
        // Get the text value of the current node.
-       [TODO]
        public override String Value
                        {
                                get
                                {
!                                       // TODO
!                                       return null;
                                }
                        }
--- 817,832 ----
  
        // Get the text value of the current node.
        public override String Value
                        {
                                get
                                {
!                                       if(currentNode != null)
!                                       {
!                                               return currentNode.Value;
!                                       }
!                                       else
!                                       {
!                                               return String.Empty;
!                                       }
                                }
                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]