public void WhiteSpacesAndEmptyValues()
        {

            // "When Microsoft’s DOM builder receives a text node from the parser
            // that contains only white space, it is thrown away." - so if it's ONLY
            // spaces, it's nothing, but spaces are NOT trimmed.

            // For attributes, spaces are preserved even when there's only spaces.

            var doc = XmlHelper.CreateXPathDocument(@"<root>
                        <item><prop/></item>
                        <item><prop></prop></item>
                        <item><prop> </prop></item>
                        <item><prop> 
                            </prop></item>
                        <item><prop> ooo </prop></item>
                        <item><prop> ooo 
                            </prop></item>
                        <item x=""""/>
                        <item x="" ""/>
                    </root>");

            var docNav = doc.CreateNavigator();

            Assert.AreEqual(@"<root>
  <item>
    <prop />
  </item>
  <item>
    <prop></prop>
  </item>
  <item>
    <prop></prop>
  </item>
  <item>
    <prop></prop>
  </item>
  <item>
    <prop> ooo </prop>
  </item>
  <item>
    <prop> ooo 
                            </prop>
  </item>
  <item x="""" />
  <item x="" "" />
</root>".Lf(), docNav.OuterXml.Lf());

            docNav.MoveToRoot();
            Assert.IsTrue(docNav.MoveToFirstChild());
            Assert.IsTrue(docNav.MoveToFirstChild());
            Assert.IsTrue(docNav.MoveToFirstChild()); // prop
            Assert.IsTrue(docNav.IsEmptyElement);
            Assert.IsTrue(docNav.MoveToParent());
            Assert.IsTrue(docNav.MoveToNext());
            Assert.IsTrue(docNav.MoveToFirstChild()); // prop
            Assert.IsFalse(docNav.IsEmptyElement);
            Assert.AreEqual("", docNav.Value); // contains an empty text node
            Assert.IsTrue(docNav.MoveToParent());
            Assert.IsTrue(docNav.MoveToNext());
            Assert.IsTrue(docNav.MoveToFirstChild()); // prop
            Assert.IsFalse(docNav.IsEmptyElement);
            Assert.AreEqual("", docNav.Value); // contains an empty text node

            var source = new TestSource8();
            var nav = new NavigableNavigator(source);

            // shows how whitespaces are handled by NavigableNavigator
            Assert.AreEqual(@"<root id=""-1"" attr="""">
  <item id=""1"" attr="""">
    <prop />
  </item>
  <item id=""2"" attr="""">
    <prop></prop>
  </item>
  <item id=""3"" attr=""   "">
    <prop>   </prop>
  </item>
  <item id=""4"" attr="""">
    <prop>
</prop>
  </item>
  <item id=""5"" attr=""  ooo  "">
    <prop>   ooo   </prop>
  </item>
</root>".Lf(), nav.OuterXml.Lf());
        }
        public void WhiteSpacesAndEmptyValues()
        {
            // "When Microsoft’s DOM builder receives a text node from the parser
            // that contains only white space, it is thrown away." - so if it's ONLY
            // spaces, it's nothing, but spaces are NOT trimmed.

            // For attributes, spaces are preserved even when there's only spaces.

            var doc = XmlHelper.CreateXPathDocument(@"<root>
                        <item><prop/></item>
                        <item><prop></prop></item>
                        <item><prop> </prop></item>
                        <item><prop> 
                            </prop></item>
                        <item><prop> ooo </prop></item>
                        <item><prop> ooo 
                            </prop></item>
                        <item x=""""/>
                        <item x="" ""/>
                    </root>");

            var docNav = doc.CreateNavigator();

            Assert.AreEqual(@"<root>
  <item>
    <prop />
  </item>
  <item>
    <prop></prop>
  </item>
  <item>
    <prop></prop>
  </item>
  <item>
    <prop></prop>
  </item>
  <item>
    <prop> ooo </prop>
  </item>
  <item>
    <prop> ooo 
                            </prop>
  </item>
  <item x="""" />
  <item x="" "" />
</root>".Lf(), docNav.OuterXml.Lf());

            docNav.MoveToRoot();
            Assert.IsTrue(docNav.MoveToFirstChild());
            Assert.IsTrue(docNav.MoveToFirstChild());
            Assert.IsTrue(docNav.MoveToFirstChild()); // prop
            Assert.IsTrue(docNav.IsEmptyElement);
            Assert.IsTrue(docNav.MoveToParent());
            Assert.IsTrue(docNav.MoveToNext());
            Assert.IsTrue(docNav.MoveToFirstChild()); // prop
            Assert.IsFalse(docNav.IsEmptyElement);
            Assert.AreEqual("", docNav.Value);        // contains an empty text node
            Assert.IsTrue(docNav.MoveToParent());
            Assert.IsTrue(docNav.MoveToNext());
            Assert.IsTrue(docNav.MoveToFirstChild()); // prop
            Assert.IsFalse(docNav.IsEmptyElement);
            Assert.AreEqual("", docNav.Value);        // contains an empty text node

            var source = new TestSource8();
            var nav    = new NavigableNavigator(source);

            // shows how whitespaces are handled by NavigableNavigator
            Assert.AreEqual(@"<root id=""-1"" attr="""">
  <item id=""1"" attr="""">
    <prop />
  </item>
  <item id=""2"" attr="""">
    <prop></prop>
  </item>
  <item id=""3"" attr=""   "">
    <prop>   </prop>
  </item>
  <item id=""4"" attr="""">
    <prop>
</prop>
  </item>
  <item id=""5"" attr=""  ooo  "">
    <prop>   ooo   </prop>
  </item>
</root>".Lf(), nav.OuterXml.Lf());
        }