Admin Admin
عدد المساهمات : 36 تاريخ التسجيل : 04/05/2011
| موضوع: XML--------- الإثنين يونيو 20, 2011 12:13 pm | |
| introduction
XML stands for eXtensible Markup Language.
XML is designed to transport and store data.
HTML was designed to display data.
XML is important to know, and very easy to learn.
XML Example
<?xml version="1.0" encoding="UTF-8" ?> - <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2011-10-29T03:01:23"> - <Cost> <Course_x0020_Name>إدخال البيانات و معالجة النصوص</Course_x0020_Name> <NCourse>100</NCourse> <Cost>600</Cost> </Cost> </dataroot>
What is XML
XML is a markup language much like HTML
XML was designed to carry data, not to display data
XML tags are not predefined. You must define your own tags
XML is designed to be self-descriptive
All XML Elements Must Have a Closing Tag
In XML, it is illegal to omit the closing tag. All elements must have a closing tag:
<P>This is a paragraph</P> <P>This is another paragraph</P>
XML Tags are Case Sensitive
XML tags are case sensitive. With XML, the tag <Letter> is different from the tag <letter>.
Opening and closing tags must be written with the same case:
<Message>This is incorrect</message> <message>This is correct</message>
XML Elements Must be Properly Nested
In XML, all elements must be properly nested within each other:
<b><i>This text is bold and italic</i></b>
XML Documents Must Have a Root Element
XML documents must contain one element that is the parent of all other elements. This element is called the root element.
XML Attribute Values Must be Quoted
In XML the attribute value must always be quoted. See the two XML documents below. The first one is incorrect, the second is correct:
<note date=12/11/2007> <to>Nasser</to> <from>Saud</from> </note>
-----------
<note date=“12/11/2007”> <to>Nasser</to> <from>Saud</from> </note>
Comments in XML
The syntax for writing comments in XML is similar to that of HTML.
<!-- This is a comment --> | |
|