You are here

More on Extensible Markup Language (XML)

14 January, 2015 - 15:59

You can see from the previous activity that XML files can be viewed as a document tree or they can be formatted using Cascading Style Sheets (CSS). There’s another technology called Extensible Style Sheets (XSL), which can also be used to change the appearance of XML files when displayed. XSL is an advanced topic that is beyond the scope of this module.

When editing XML documents, you must keep in mind the following rules:

  1. The document begins with a processing instruction <?xml ...?>. This identifies the file as an XML document and states the encoding scheme used.
  2. Opening tags must have closing tags.
  3. Tags must be nested properly.
  4. Values in a tag must be enclosed in quotation marks.

XML documents that observe the rules above are considered well-formed. It takes a while to get used to XML’s strictness when you’ve been spoiled by HTML’s leniency. Just remember that this newfound discipline will pay off in the form of pages that are less error-prone and easier to maintain.