当前位置:网站首页>XML learning notes

XML learning notes

2022-06-27 00:40:00 zfoo-framework

1)xml:  Extensible markup language  Extensible markup language

2) Extensible meaning :  The tags are all custom , For example, there can be  <user> <student>. and html The labels belong to others .

3) function :	xml and html Have a common father :w3c( World wide web consortium )
	html Is a loose language ,xml To replace html, But there is no functional improvement , In the end, he didn't win .
	
	 Then and properties competition :
		name=zhangsan 
		age=23
		gender=nan
		
		
	xml Easy to read , Clear , It has found its own direction : It is no longer a presentation of data , It's storing data ( The configuration file 、 To transmit in a network )	
	<user id='1'>
		<name>zhangsan</name>
		<age>23</age>
		<gender>nan</gender>
	</user>
	
4) contrast :
	xml Labels are custom ,html Tags are predefined .
	xml Strict grammar ,html Loose grammar .
	xml It's storing data ,html It's showing data .
	
	
5) The document statement 

6)xml There is also a parsing engine , Drag to the browser without reporting an error , Then : Correct .

7) Who wrote it xml?
	 Who parses xml?
	
   explain ( constraint ) file : Specifies the xml Rules for writing documents .

8) Constraint technology :
	 The most primitive is dtd: A simple constraint , The disadvantage is that : Cannot constrain content .
	schema:  Suffix is xsd.
		xsd:sequence    //  Appear in order 
		xsd:complexType // 

9)xml analysis 
	dom: take xml Load into memory at one time , formation dom Trees .
			 advantage : It is easy to operate , You can do CRUD operation .
			 shortcoming :1M Documents , Load it once , Probably 1000~1W M about .  So it takes up a lot of memory .
			
	SAX:  Read line by line , Based on event driven . Read a line , Just release one line , There is only one line in memory .
			 advantage : Basically does not occupy memory .
			 shortcoming : Can only read .

10)xml Common parsers 
	jaxp:sun Support provided by the company dom and sax, Very slowly .
	dom4j:  An excellent , Commonly used in parsers .
	jsoup:  Often used to parse html.
	pull:android Built in parser .sax The way .

	














原网站

版权声明
本文为[zfoo-framework]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206270004438543.html