2 xml
2 xml
UTF-16:
It uses 16-bits to represent the characters.
Example:
You can use encoding inside the XML declaration. UTF-8 is the default encoding in XML.
XML Syntax
The below code segment shows the basic XML syntax.
XML Declaration
XML declaration consists of the XML version, character encoding or/and standalone status. The declaration is optional.
Syntax for XML Declaration
The below code segment shows the syntax for XML declaration.
<name>...</name>
<result></result>
Example:
Correct: <age>20</age>
Wrong:
<age>20</Age>
Note: AGE, Age, and age are three different names in XML.
All XML documents must contain a single root element.
Example:
There are two attributes in the company element, i.e. name and location.
For example, the < and > symbols are used for tags. You cannot directly type from the keyboard for less than and
greater than signs. Instead, you need to use entities.