XML Tutorial!

What is XML?

XML refers to extensible markup language (eXtensible Markup Language), which is a markup language, much like HTML. It was designed purpose is to transmit data rather than displaying data. XML tags are not predefined and user-defined labels on their own needs. XML technology is released by W3C organization (World Wide Web Consortium World Wide Web Consortium), currently follows the W3C organization released in 2000 XML1.0 specification. XML is widely considered following Java on the Internet's most exciting new technology.

 

Html tag is fixed inside, each tab has a specific meaning <h1> <br/> <hr />, you can define your own label, the label can be written in Chinese.

Uses: html for displaying data, XML data may be displayed (not the primary function), xml main functions, for storage.

 

XML advantages:        1. Data Reuse

                            2. Data indicating separation

                            3. Scalability

                            4. semantic information

 

The root element

XML document must be contained in a single element. This single element is called the root element, which contains all the text in the document and all other elements. Not a single document that contains elements no matter what the document might contain information, XML parser will reject it.

Each XML document must have all the elements and other elements is only one root element, the root element is a fully included in the document. Before the start tag of the root element to be placed in the starting mark all other elements, marking the end of the root element to be placed after the end of all the other elements of the mark.

 

mark

Tag is a left angle bracket "<" and the right angle bracket ">" between the text. There are start and end tags "<name> </ name>". I could not spare any end tags. If an element does not include tags, known as empty elements; "<br>" is an example HTML line breaks. Empty elements in an XML document, you can put the closing slash in the start tag.

 

Character data

Text between the start and end tags is defined as "character data", it can be any valid character other than "<" is. Character data into PCDATA and CDATA.

PCDATA: XML support Unicde character set, it can contain letters / numbers / punctuation / symbols in the text. Because XML uses <,>, and & defined tag, if included in the text of these characters, the entity must be used instead.

CDATA: In special mark CDATA, all tags, entity references are ignored and regarded as XML handlers non-discriminatory character data.

 

Ali cloud the new university "Learning + test" mode that provides the basis of test questions Java (currently have 58522 participants), to assess your Java basic level, take the test after learning to enhance the effect is more accurate! Immediately begin testing: https://edu.aliyun.com/clouder/exam

XML free learning videos: https://edu.aliyun.com/course/1708/lesson

Guess you like

Origin blog.csdn.net/weixin_40050195/article/details/90672667