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)