Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

XML Tutorial Part 5 : XML Syntax

XML Syntax refers to the rules that determine how an XML application can be written. The Xml Syntax is very straight forward, and this makes XML very easy to learn. Below are the main points to remember when creating XML documents.

Well-formedness

The W3C specifies that all XML documents must be well-formed. Specifically, a textual object is a well-formed XML document if:

  • Taken as a whole, it matches the production labeled document
  • It meets all the well-formedness constraints given the XML specification
  • Each of the parsed entities which is referenced directly or indirectly within the document is well-formed

If this all sounds confusing, don't worry too much. Basically, all you need to do is ensure you build your XML applications correctly!

XML Declaration

If you include an Xml Declaration, it must be the first item in your document. The XML declaration uses the element.

Example:


 

One Root Element Only

Each XML document must have one Root Element and no more. All other elements must be contained within the root element.

Example:


Data
More Data

XML Markup

Generally speaking, an XML document consists of markup and data. Markup is provided in the form of tags and attributes. Data is the text that goes in between the tags or is provided within their attributes.

The next couple of lessons cover the key syntax rules related to elements and attributes.



This post first appeared on Just Sharing, please read the originial post: here

Share the post

XML Tutorial Part 5 : XML Syntax

×

Subscribe to Just Sharing

Get updates delivered right to your inbox!

Thank you for your subscription

×