XML Syntax Rules

We have covered a lot of information at this point; but as we mentioned before, XML is very simple, and there are just a few things you need to remember when working with it. Let's review some of what we've learned about creating XML:

  • XML documents are composed of Unicode characters.

  • XML is case-sensitive.

  • Whitespace and characters such as spaces (ASCII 32), tabs (ASCII 9), carriage returns (ASCII 13), and line feeds (ASCII 10) are ignored inside of tags, but whitespace is passed on by an XML parser to its calling application. Whitespace outside of elements can be significant to the parsing application.

  • XML names must begin with a letter or an underscore followed by any number of letters, digits, hyphens, underscores, or periods. For more information on characters that might need to be escaped, refer to the XML specification at www.w3.org/TR/REC-xml. Element names cannot contain spaces.

  • Attributes must be quoted.

  • XML is a reserved namespace, and XML names cannot begin with the letters "xml" in any variation, upper- or lowercase.

  • XML tags must be properly nested. If an element exists inside another element, its ending tag must be before the ending element's ending tag. An empty tag is one that ends with a forward slash before the right-angle bracket. All starting tags must end with an ending tag.

  • An XML document can have only one root element.

Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net