XML Tutorial : Introduction to XML

XML stands for EXtensible Markup Language

XML Document below :
 <ORDER>
<NUM> PO-1234 </NUM>
<CUSTID> SAM </CUSTD>
<ITEM> COMPUTER </ITEM>
<QUANTITY> 5 </QUANTITY>
<PRICE> 138 </PRICE>
</ORDER>

Components of an XML Document :

Elements

  1. Each element has a beginning and ending tag . <TAG_NAME>…</TAG_NAME>
  2. Elements can be empty (<TAG_NAME />)

Attributes

  1. Describes an element; e.g. data type, data range, etc.
  2. Can only appear on beginning tag
Processing instructions
  1. Encoding specification (Unicode by default)
  2. Namespace declaration
  3. Schema declaration

Rules of Well Formed XML

  1. XML is case-sensitive
  2. There must be one, and only one, root element
  3. Sub-elements must be properly nested
  4. A tag must end within the tag in which it was started
  5. Attributes are optional
  6. Defined by an optional schema
  7. Attribute values must be enclosed in “” or ‘’
  8. Processing instructions are optional

Leave a Reply

Discover more from Abhyas

Subscribe now to keep reading and get access to the full archive.

Continue reading