Wednesday, November 3, 2010

XML Tags

The information in XML document is contained within various tags that constitute the markup of the document.

XML Tags begin with <> sign, that is not inside a comment or a CDATA session.

The tags are paired, so that any opening tag must have a closing tag. The end-tags are same as start-tags except that they have a / right after the opening < character.

All of the information from the beginning of the start-tag to the end-tag, and including every thing in between is called an element.

The text between start-tag and end-tag is called the element content.

XML Tag Rules

  • All well-formed XML document must have at least one element.
  • Maintain case within a tag set.
  • XML elements may contain other elements but the nesting of elements must be correct.
  • Tags Naming
  1. Tags should begin with either a letter, an underscore(_) or a colon (:) followed by some combination of letters, numbers, periods (.), colons, underscores, or hyphens (-) but no white space. It is also a good idea to not use colons as the first character in a tag name even if it is legal.
  2. Names cannot contain spaces.
  3. Names can't start with the letters xml, in uppercase, lowercase, or mixed. you can't start a name with xml, XML, XmL or any other combination.
  • Define Valid Attributes
Tags may specify any number of supporting attributes. Attributes, must not duplicate in any one tag, specify name/value pair delimited by equal (=) sign in which the value is delimited by quotation marks.

No comments:

Post a Comment