Comment Nodes

Hiya!!

DOM level 2 defines a comment interface.We can Create comment nodes etc.

But, Are the Comments specified in XMU file stored in the corresponding DOM as comment nodes




Thanks




Answer this question

Comment Nodes

  • canadian_coder

    You are not allowed to do that; you can't have comments inside the div tag. If you have a validating XML editor like Visual Studio Web Express (free download) it will tell you these things as you write your XML.

    So your "ohh la la" comment is invalid XML, but if you remove that then "hey hey hey" will be a child of the div (assuming the rest of the document is valid, etc.)

    Note that you will also have text nodes anywhere you have whitespace, so it won't be the first child node. Probably the second.



  • cb3431

    Ah Well

    Consider the case

    <div id="div1" <!--ooh la la --> blah="moo" >
    <!-- hey hey hey -->


    What are the expected parent child relationships for the comments inside the div

    Thanks







  • Andy1988

    yes. All the nodes in xmu file will be in corresponding DOM
  • Comment Nodes