2. WHAT IS XML
XML is a software- and hardware-independent tool for carrying
information.
XML stands for Extensible Markup Language;
XML is a markup language much like HTML;
XML was designed to describe data, not to display data like
HTML;
XML tags are not predefined. You must “invent” your own tags;
XML is designed to be self-descriptive.
3. WHERE IT IS APPLIED?
XML is used in many aspects of web development, often to
simplify data storage and sharing.
XML data is stored in text format. This makes it easier to expand or
upgrade to new operating systems, new applications, new
browsers without losing data.
With XML, your data can be avaliable to all kinds of “Reading
Machines” (Handheld computers, voice machines, news feeds,
etc.)
4. XML STRUCTURE
The first line in the XML declaration defines the XML version and
the encoding used;
The next line describes the root element of the document;
Next is the child elements of the root (<to>,
<from>,<heading>,<body>)
The last line defines the end of the root element.
<?xml version = “1,0” encoding = “UTF-8”?>
<note>
<to>Mary</to>
<from>Lois</from>
<heading>Reminder</heading>
<body>Hello how are you?</body>
</note>
5. XML SYNTAX RULES
All XML elements must have a closing tag.
XML tags are case-sensitive.
XML documents must have a root element.
XML attributes values must be quoted.
6. XML SYNTAX RULES
Entity References:
Are used to avoid errors with some charaters like “<“ and “>”
< < Less than
> > Greater than
& & Ampersand
&apos ‘ Apostrophe
" “ Quoatation mark
7. XML SYNTAX RULES
Comments in XMLm are made this way: (<!-- comment-->).
White-spaces are preserved in XML.
XML store new lines as LF.
8. XML ELEMENTS
XML element is everything from the element’s start tag to the
element’s end tag.
Empty elements in XMLn are represented
by:<example></example> or <example />.
XML naming rules:
Element names are case-sensitive;
Element names must start with a letter or undrscore:
Element names cannot start with the letters xml;
Element names cannot contain spaces;
9. XML ATTRIBUTES
XML elements ca have attributes, that provide additional
information about it.
XML attributes must be quoted. (e.g. <dog size= “big”>).
Problems of attributes:
attributes cannot contain multiple values (elements can)
attributes cannot contain tree structures (elements can)
attributes are not easily expandable (for future changes)
10. XML ENCODING
Use a XML editor that supports encoding.
Make sure you know what encoding the editor uses.
Describe the encoding in the encoding attribute.
UTF-8 is the safest encoding to use.
UTF-8 is the web standard.
11. CONCLUSION
The XML can be a great ally in developing applications for the
Internet. We have seen that it does not replace HTML, but fills a
great need of this language, providing a really efficient way to
transmit all kind of data through the World Wide Web. I hope this
slides helped, in a definitive way, to understand what is XML
language.