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 XmlDocument.cs,1.13,1.14


From: Adam Ballai <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Xml XmlDocument.cs,1.13,1.14 XmlTextReader.cs,1.37,1.38
Date: Mon, 31 Mar 2003 19:36:52 -0500

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

Modified Files:
        XmlDocument.cs XmlTextReader.cs 
Log Message:
fix for bug(3012) and more implementing

Index: XmlDocument.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/XmlDocument.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** XmlDocument.cs      18 Feb 2003 01:37:48 -0000      1.13
--- XmlDocument.cs      1 Apr 2003 00:36:50 -0000       1.14
***************
*** 623,630 ****
  
        // Load XML into this document.
-       [TODO]
        public virtual void Load(Stream inStream)
                        {
!                               // TODO
                        }
        public virtual void Load(String filename)
--- 623,630 ----
  
        // Load XML into this document.
        public virtual void Load(Stream inStream)
                        {
!                               RemoveAll();
!                               Load(new XmlTextReader(inStream));
                        }
        public virtual void Load(String filename)
***************
*** 637,644 ****
                                Load(new XmlTextReader(filename));
                        }
-       [TODO]
        public virtual void Load(TextReader txtReader)
                        {
!                               // TODO
                        }
        public virtual void Load(XmlReader reader)
--- 637,644 ----
                                Load(new XmlTextReader(filename));
                        }
        public virtual void Load(TextReader txtReader)
                        {
!                               RemoveAll();
!                               Load(new XmlTextReader(txtReader));
                        }
        public virtual void Load(XmlReader reader)
***************
*** 647,653 ****
                                RemoveAll();
                                XmlNode node;
!                               while((node = ReadNode(reader)) != null)
                                {
!                                       AppendChild(node);
                                }
                        }
--- 647,665 ----
                                RemoveAll();
                                XmlNode node;
!               
!                               try
!                               {
!                                       
if(!BuildStructure((XmlTextReader)reader))
!                                       {
!                                               throw new XmlException(
!                                                               
S._("XmlException_NoXml"));
!                                       }
!                                       
!                                       
!                               }
!                               catch(XmlException e)
                                {
!                                       throw new XmlException(
!                                                       
S._("XmlException_ParseError"));
                                }
                        }
***************
*** 658,666 ****
                                if (xml == null || xml == String.Empty)
                                {
!                                       throw(new XmlException("no Xml to 
parse", null));
                                }
                                
                                XmlTextReader reader = new XmlTextReader(xml, 
XmlNodeType.Element, null);
!                               BuildStructure(reader);
                        }
  
--- 670,687 ----
                                if (xml == null || xml == String.Empty)
                                {
!                                       throw new XmlException(
!                                                       
S._("XmlException_NoXml"));
                                }
                                
                                XmlTextReader reader = new XmlTextReader(xml, 
XmlNodeType.Element, null);
!                               try
!                               {
!                                       BuildStructure(reader);
!                               }
!                               catch(XmlException e)
!                               {
!                                       throw new XmlException(
!                                                       
S._("XmlException_ParseError"));
!                               }
                        }
  
***************
*** 671,696 ****
                                XmlNode current = null;
  
!                               while (reader.Read())
!                               {
!                                       if (reader.IsStartElement() == true)
!                                       {
!                                               XmlElement elem = 
this.CreateElement(reader.Name);
!                                               parent.AppendChild(elem);
!                                               parent = elem;
!                                               current = elem;
!                                       }
!                                       else
!                                       {
!                                               parent = parent.ParentNode;
!                                       }
!                                       if (reader.NodeType == XmlNodeType.Text)
!                                       {
!                                               // If node has body text
!                                               current.InnerText = 
reader.Value;
!                                       }
!                               }
                                
!                               if (this.ChildNodes.Count >0)
                                {
                                        return true;
                                }
--- 692,701 ----
                                XmlNode current = null;
  
!                               parent = ReadNode(reader);
                                
!                               if(parent != null)
                                {
+                               
+                                       this.AppendChild(parent);
                                        return true;
                                }
***************
*** 702,706 ****
  
        // Read a node into this document.
!       public virtual XmlNode ReadNode(XmlReader reader)
                        {
                                XmlNode currentNode = null,
--- 707,711 ----
  
        // Read a node into this document.
!       public virtual XmlNode ReadNode(XmlTextReader reader)
                        {
                                XmlNode currentNode = null,

Index: XmlTextReader.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/XmlTextReader.cs,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** XmlTextReader.cs    10 Mar 2003 00:10:00 -0000      1.37
--- XmlTextReader.cs    1 Apr 2003 00:36:50 -0000       1.38
***************
*** 168,172 ****
                                if(input is StreamReader)
                                {
!                                       encoding = 
((XmlStreamReader)input).CurrentEncoding;
                                }
                        }
--- 168,172 ----
                                if(input is StreamReader)
                                {
!                                       encoding = 
((StreamReader)input).CurrentEncoding;
                                }
                        }





reply via email to

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