2003-10-04 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
authorAtsushi Eno <atsushieno@gmail.com>
Sat, 4 Oct 2003 05:31:51 +0000 (05:31 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Sat, 4 Oct 2003 05:31:51 +0000 (05:31 -0000)
* DTMXPathDocumentBuilder.cs : Bugfix for whitespace handling.

svn path=/trunk/mcs/; revision=18583

mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder.cs

index 97328fb2f5af35adaea937ad092e0cf7e9fbe528..6b63f92dd9f915e5e115129d928127ad9e6485fb 100644 (file)
@@ -1,3 +1,7 @@
+2003-10-04  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
+
+       * DTMXPathDocumentBuilder.cs : Bugfix for whitespace handling.
+
 2003-10-01  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
 
        * Added DTMXPathNode.cs.
index 079b30f2bc64d0137adffd9219ce2bf0c8af48cc..3988934d88e2e2c1d1a3d62edd895055a59bc333 100644 (file)
@@ -49,7 +49,7 @@ namespace Mono.Xml.XPath
                        if (supportsID)
                                this.validatingReader = reader as XmlValidatingReader;
                        lineInfo = reader as IXmlLineInfo;
-                       this.xmlSpace = xmlSpace;
+                       this.xmlSpace = space;
                        this.nameTable = reader.NameTable;
                        nodeCapacity = nodeCapacity;
                        attributeCapacity = nodeCapacity * 2;
@@ -182,7 +182,8 @@ namespace Mono.Xml.XPath
                        requireFirstChildFill = false;  // Might be changed in ProcessElement().
 
                        string value = null;
-                       XPathNodeType nodeType = XPathNodeType.Text;
+                       XPathNodeType nodeType = xmlReader.NodeType == XmlNodeType.Whitespace ?
+                               XPathNodeType.Whitespace : XPathNodeType.Text;
 
                        switch (xmlReader.NodeType) {
                        case XmlNodeType.Element:
@@ -191,6 +192,7 @@ namespace Mono.Xml.XPath
                        case XmlNodeType.CDATA:
                        case XmlNodeType.SignificantWhitespace:
                        case XmlNodeType.Text:
+                       case XmlNodeType.Whitespace:
                                if (value == null)
                                        skipRead = true;
                                AddNode (parent,
@@ -219,8 +221,6 @@ namespace Mono.Xml.XPath
                                value = xmlReader.Value;
                                nodeType = XPathNodeType.Comment;
                                goto case XmlNodeType.Text;
-                       case XmlNodeType.Whitespace:
-                               goto case XmlNodeType.Text;
                        case XmlNodeType.ProcessingInstruction:
                                value = xmlReader.Value;
                                nodeType = XPathNodeType.ProcessingInstruction;