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>
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
- Each element has a beginning and ending tag . <TAG_NAME>...</TAG_NAME>
- Elements can be empty (<TAG_NAME />)
Attributes
- Describes an element; e.g. data type, data range, etc.
- Can only appear on beginning tag
Processing instructions
- Encoding specification (Unicode by default)
- Namespace declaration
- Schema declaration
Rules of Well Formed XML
- XML is case-sensitive
- There must be one, and only one, root element
- Sub-elements must be properly nested
- A tag must end within the tag in which it was started
- Attributes are optional
- Defined by an optional schema
- Attribute values must be enclosed in “” or ‘’
- Processing instructions are optional
No comments:
Post a Comment