首页 > 其他 > 详细

The Xml basic part

时间:2017-07-08 22:19:16      阅读:392      评论:0      收藏:0      [点我收藏+]

Today I reviewed the xml part.

Xml‘s full name is Extensible Markup Language which produced from SGML(Standard Generalized Markup Language).

Why do you learn it?

The xml could store the data and describe the data.For example:

  <Person>

    <name>Peter</name>

    <age>23</age>

  </Person>

We can see from this little code:

  The code include the Person‘s info and each parameter has its own value.The Person‘s filed is so clear.And the data could be get conveniently.

 

Xml file start with:

  <? xml version="1.0" encoding="utf-8"?>      in the first line(document assertion)

  <! DOCTYPE demo SYSTEM "demo.dtd" >     document‘s type definition

  <!-- comment content -->             the comment  

There should be only one root element in the xml file.And the root element include :

  1.child element

  2.element‘s parameter

  3.element‘s text content

  4.CDATA(character data) for example:

    <![CDATA{

      if(2<3){

        System.out.println("hello CDATA!");

      }

    ]]>

  How to remember the CDATA‘s format?

    <!>  ->  <![]>  ->  <![CDATA[  text content  ]]>

  

   

  

The Xml basic part

原文:http://www.cnblogs.com/ppcoder/p/7138208.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!