Part of XML’s popularity is a result of its simplicity. When creating your own XML document,
to remember only a few rules:
). Content is placed between the start and end tags. If you include a
start tag, you must also include a corresponding end tag. The only other option is
to combine the two by creating an empty element, which includes a forward
slash at the end and has no content (like ). This is similar to the syntax
for ASP.NET controls.
and hard returns to properly align your information.
special characters, such as the angle brackets (< >) and the ampersand (&), as
content. Instead, you’ll have to use the entity equivalents (such as < and >
for angle brackets, and & for the ampersand). These equivalents will be
automatically converted to the original characters when you read them into your
program with the appropriate .NET classes.
example, the root element is . As soon as the root element
is closed, the document is finished, and you cannot add anything else after it. In
other words, if you omit the element and start with a
element, you’ll be able to enter information for only one product; this
is because as soon as you add the closing , the document is complete.
(HTML has a similar rule and requires that all page content be nested in a root