XML learning notes (1)

Source: Internet
Author: User
Tags xml parser

XML learning notes

XML: extensible HTML Tag provided by W3C

Role: storage, Configuration

Data is stored in XML. After the XML file is written, the program needs to read the data. The process of reading the program is called parsing.

XML can be parsed in two ways: Dom (document objecct model Document Object Model) The resolution mode recommended by W3C
SAX (Simple API for XML) is the de facto standard of the XML community. Almost all XML parsers support it.

 

XML Parser: crimson (Sun) xerces (IBM) aelfred2 (dom4j)

XML parsing Development Kit: JAXP (Sun) JDOM dom4j pull (comes with Android SDK)


XML constraints (write a document to restrict the current XML document)

Classification DTD, schema

XML parsing Dom Document Object Model W3C recommended parsing mode

 

 1 <?xml version="1.0" encoding="utf-8"?> 2 <bookstore> 3 <book category = "COOKING"> 4 <title lang = "en">Everyday Italian</title> 5 <author>ermao</author> 6 <year>2013</year> 7 <price>30.00</price> 8  9 </book>10 <book category = "Web">11 <title lang = "en" >Learning XML</title>12 <author>dandan</author>13 <year>2014</year>14 <price>23.00</price>15 </book>16 </bookstore>

 


Dom parsing advantages: because it is loaded into the memory, crud operations will be faster.
Disadvantage: too much data is loaded in the memory, which may cause memory overflow.

XML learning notes (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.