XML comments viewed in browser

H

Ha

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top