• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

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.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint