XML comments viewed in browser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ha

    #1

    XML comments viewed in browser

    I have the following piece of XML:
    <?xml version="1.0" encoding="UTF-8" ?>
    <TopLevel> <!-- TopLevel comment -->
    <SubLevel /> <!-- SubLevel comment -->
    </TopLevel>

    When viewed in the browser it looks like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <TopLevel>
    <!-- TopLevel comment -->
    <SubLevel />
    <!-- SubLevel comment -->
    </TopLevel>

    This makes it hard to determine which element the comment refers to.
    Is there a way to have the comments output on the same line, or is
    this dependent on the browser?

    Finally, should comments generally be placed before the element is
    defined?

    Thanks.
Working...