Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line breaks for nested elements?

Status
Not open for further replies.

mrtorrent

Programmer
Jun 25, 2002
2
US
Just curious, in all examples (i.e. in tutorials, books, etc.) I see child/sub-elements on a NEW line from the main element, for example:
<note>
<title>foo</title>
<message>bar</message>
</note>
I've never seen:
<note><title>foo</title>
<message>bar</message></note>

What I'd like to know is: is this a REQUIREMENT of XML, that each element be on its own line, or is this just a style nicety that most people obey?
 
It's not a requirement. XML is perfectly happy with all elements on a single line. Breaking it up onto multiple lines only makes the file larger (but humans seem to like it).

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top