XML comments viewed in browser

Discussion in 'XML' started by Ha, Jul 24, 2003.

  1. Ha

    Ha Guest

    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.
    Ha, Jul 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. D.Rudiani
    Replies:
    2
    Views:
    304
    Ken Cox [Microsoft MVP]
    Mar 8, 2005
  2. =?Utf-8?B?SklNLkgu?=

    Q: prevent the source code from being viewed

    =?Utf-8?B?SklNLkgu?=, Mar 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    524
    Kevin Spencer
    Mar 22, 2005
  3. Replies:
    0
    Views:
    1,117
  4. Monk
    Replies:
    10
    Views:
    1,461
    Michael Wojcik
    Apr 20, 2005
  5. Replies:
    4
    Views:
    603
    Dr John Stockton
    Jun 3, 2006
Loading...

Share This Page