Loading ...
Sorry, an error occurred while loading the content.
 

Can Text Elements Have Siblings? (was Re: cloud)

Expand Messages
  • Randy Morin
    .NET 2.0 XmlDocument interprets that as 3 child elements code... System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(
    Message 1 of 8 , Feb 13, 2006
      .NET 2.0 XmlDocument interprets that as 3 child elements

      code...

      System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
      doc.LoadXml("<item xmlns:ext='ext'><title>Hi
      <ext:e>there</ext:e>dude</title></item>");
      foreach (System.Xml.XmlNode e in doc.DocumentElement["title"])
      {
      System.Console.WriteLine("{0} = {1}", e.NodeType, e.OuterXml);
      }

      result...

      Text = Hi
      Element = <ext:e xmlns:ext="ext">there</ext:e>
      Text = dude

      Randy

      --- In rss-public@yahoogroups.com, "rcade" <rcade@...> wrote:
      > Would an XML parser properly view title as the parent of three
      child
      > elements ...
      >
      > 1. The text "Hi "
      > 2. The namespaced element ext:e
      > 3. The text "dude"
      >
      > ... or two ...
      >
      > 1. The text "Hi dude"
      > 2. The namespaced element ext:e
      >
      > ?
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.