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 XmlTextReader.cs,1.18,1.19


From: adam ballai <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Xml XmlTextReader.cs,1.18,1.19
Date: Mon, 13 Jan 2003 13:10:48 -0500

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

Modified Files:
        XmlTextReader.cs 
Log Message:


Index: XmlTextReader.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/XmlTextReader.cs,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** XmlTextReader.cs    12 Jan 2003 11:08:59 -0000      1.18
--- XmlTextReader.cs    13 Jan 2003 18:10:45 -0000      1.19
***************
*** 499,503 ****
                                                nodeType = 
XmlNodeType.EndElement;
                                                isEmpty = true;
!                                               return builder.ToString();
                                        }
                                        else if((char)ch == '>')
--- 499,503 ----
                                                nodeType = 
XmlNodeType.EndElement;
                                                isEmpty = true;
!                                               return builder.ToString(0, 
builder.Length -1);
                                        }
                                        else if((char)ch == '>')
***************
*** 619,623 ****
                                                break;
                                        case '?':
!                                               // TODO: Processing Instructions
                                                if(structFlag != true)
                                                {
--- 619,624 ----
                                                break;
                                        case '?':
!                                               // Processing Instructions
!                                               // <? PITarget 
                                                if(structFlag != true)
                                                {
***************
*** 625,631 ****
                                                                
(S._("Xml_Malformed"));
                                                }
! 
                                                ch = ReadChar();
!                                               AnalyzeChar(ch, true);
                                                break;
                                        case '!':
--- 626,674 ----
                                                                
(S._("Xml_Malformed"));
                                                }
!                                               ClearNodeInfo();
                                                ch = ReadChar();
!                                               if((char)ch != '>')
!                                               {
!                                                       // get Processing 
Target 
!                                                       AnalyzeChar(ch, true);
!                                               }
!                                               else
!                                               {
!                                                       // end processing
!                                                       break;
!                                               }
!                                               
!                                               if(name != "xml")
!                                               {
!                                                       nodeType = 
XmlNodeType.ProcessingInstruction;
!                                               }
!                                               else
!                                               {
!                                                       nodeType = 
XmlNodeType.XmlDeclaration;
!                                                       while((ch = ReadChar()) 
!= -1)
!                                                       {
!                                                               if((char)ch == 
'?' && (char)reader.Peek() == '>')
!                                                               {
!                                                                       
ReadChar();
!                                                                       break;
!                                                               }
!                                                       }
!                                                       break;
!                                               }
!                                               
!                                               // clear buffer 
!                                               builder = new StringBuilder();
!                                               
!                                               while((ch = ReadChar()) != -1)
!                                               {
!                                                       
builder.Append((char)ch);
!                                                       if((char)ch == '?' && 
(char)reader.Peek() == '>')
!                                                       {
!                                                               value = 
builder.ToString(0, builder.Length -1);
!                                                               ReadChar();
!                                                               break;
!                                                       }
!                                               }
!                                               
                                                break;
                                        case '!':
***************
*** 646,651 ****
                                                if(structFlag != true)
                                                {
!                                                       throw new XmlException
!                                                               
(S._("Xml_Malformed"));
                                                }
  
--- 689,697 ----
                                                if(structFlag != true)
                                                {
!                                                       
builder.Append((char)ch);
!                                                       ch = ReadChar();
!                                                       AnalyzeChar(ch, false);
!                                                       break;
! 
                                                }
  
***************
*** 699,707 ****
                                                if(structFlag != true)
                                                {
!                                                       throw new XmlException
!                                                               
(S._("Xml_Malformed"));
                                                }
- 
-                                               // TODO: CDATA node
                                                break;
                                                        
--- 745,778 ----
                                                if(structFlag != true)
                                                {
!                                                       
builder.Append((char)ch);
!                                                       ch = ReadChar();
!                                                       AnalyzeChar(ch, false);
!                                                       break;
!                                               }
!                                               builder = new StringBuilder();
!                                               while((ch = ReadChar()) != -1)
!                                               {
!                                                       
builder.Append((char)ch);
!                                                       if((char)ch == '[')
!                                                       {
!                                                               // reset to 
grab all input between '[' ']'
!                                                               builder = new 
StringBuilder();
!                                                       }
!                                                       else if((char)ch == ']')
!                                                       {
!                                                               // for speed 
just check for first ] 
!                                                               // then we 
check for ]]> as a whole
!                                                               
builder.Append((char)ReadChar());
!                                                               
builder.Append((char)ReadChar());
!                                                               
if(builder.ToString().Substring(builder.Length - 3, 3) == "]]>")
!                                                               {
!                                                                       // 
break the read and state Value
!                                                                       
ClearNodeInfo();
!                                                                       value = 
builder.ToString(0, builder.Length -3);
!                                                                       break;
!                                                               }
!                                               
!                                                       }
                                                }
                                                break;
                                                        
***************
*** 714,737 ****
                                                        break;
                                                }
!                                               
                                                // document type nodes
                                                // clean the buffer
                                                builder = new StringBuilder();
                                                builder.Append((char)ch);
                                                while ((ch = ReadChar()) != -1)
                                                {
!                                                       
builder.Append((char)ch);
!                                                       
if(Char.IsWhiteSpace((char)reader.Peek()))
                                                        {
                                                                nodeType = 
XmlNodeType.DocumentType;
                                                                name = 
builder.ToString();
!                                                               value = 
ReadIdentifier(-1);
!                                                               
                                                                break;
                                                        }
                                                }
                                                break;
                                        case '=':
-                                               // TODO: save attribute name
                                                ClearNodeInfo();
                                                name = builder.ToString();
--- 785,831 ----
                                                        break;
                                                }
!                                               ClearNodeInfo();        
                                                // document type nodes
                                                // clean the buffer
                                                builder = new StringBuilder();
                                                builder.Append((char)ch);
+                                               count = 0;
                                                while ((ch = ReadChar()) != -1)
                                                {
!                                                       
if(Char.IsWhiteSpace((char)ch) && count == 0)
                                                        {
                                                                nodeType = 
XmlNodeType.DocumentType;
+                                                               
Console.WriteLine(builder.ToString());
+                                                               
if(builder.ToString() != "DOCTYPE")
+                                                               {
+                                                                       throw 
new XmlException
+                                                                               
(S._("Xml_Malformed"));
+                                                               }
+                                                               builder = new 
StringBuilder();
+                                                               count++;
+                                                       }
+                                                       else 
if(Char.IsWhiteSpace((char)ch) && count == 1)
+                                                       {
                                                                name = 
builder.ToString();
!                                                       }
!                                                       else if((char)ch == '[')
!                                                       {
!                                                               builder = new 
StringBuilder();
!                                                               while((ch = 
ReadChar()) != -1)
!                                                               {
!                                                                       
builder.Append((char)ch);
!                                                                       
if((char)ch == ']' && (char)reader.Peek() == '>')
!                                                                       {
!                                                                               
ReadChar();
!                                                                               
break;
!                                                                       }
!                                                               }
!                                                               value = 
builder.ToString(0, builder.Length - 1);
                                                                break;
                                                        }
+                                                       
builder.Append((char)ch);
                                                }
                                                break;
                                        case '=':
                                                ClearNodeInfo();
                                                name = builder.ToString();
***************
*** 742,746 ****
--- 836,845 ----
                                                builder = new StringBuilder();
                                                break;
+                                       case '\'':      
                                        case '"':
+ 
+                                               // get quote
+                                               quoteChar = (char)ch;
+                                               
                                                if(nodeType != 
XmlNodeType.Attribute)
                                                {
***************
*** 751,755 ****
                                                while((ch = ReadChar()) != -1)
                                                {
!                                                       if((char)ch == '"')
                                                        {
                                                                value = 
builder.ToString();
--- 850,854 ----
                                                while((ch = ReadChar()) != -1)
                                                {
!                                                       if((char)ch == 
QuoteChar)
                                                        {
                                                                value = 
builder.ToString();
***************
*** 796,800 ****
                                                {
                                                        nodeType = 
XmlNodeType.Text;
-                                                       value += (char)ch;
                                                        
                                                        ch = ReadChar(); 
--- 895,898 ----
***************
*** 807,810 ****
--- 905,909 ----
                                                        {
                                                                ungetch = ch;
+                                                               value = 
builder.ToString();
                                                        }
                                                }





reply via email to

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