w3pop.com :: ÍøÂçѧԺ :: XML :: XML ½éÉÜ
XML was designed to describe data and to focus on what data is.
XMLÓÃÓÚÃèÊöÊý¾Ý£¬²àÖØÓÚÊý¾Ý±¾Éí£¨È磺Êý¾ÝÀàÐͺÍÊý¾Ý½á¹¹£©µÄ¶¨Òå¡£
HTML was designed to display data and to focus on how data looks.
HTMLÓÃÓÚÏÔʾÊý¾Ý£¬²àÖØÓÚÊý¾ÝµÄÏÔʾÐÎʽ¡£
Before you continue you should have a basic understanding of the following:
ÔÚ¼ÌÐøÏÂÃæµÄѧϰǰ£¬Äã±ØÐë¶ÔÒÔÏÂÄÚÈÝÓлù±¾ÈÏʶ:
If you want to study these subjects first, find the tutorials on our Home page.
Èç¹ûÄãÏëÏÈѧϰÉÏÊöÄÚÈÝ£¬Çë²ÎÕÕ֪ʶ¿âµÄ½Ì³Ì¡£
The Extensible Markup Language (XML) became a W3C Recommendation 10. February 1998.
1998Äê2ÔÂ10ÈÕ£¬À©Õ¹±ê¼ÇÓïÑÔ(XML)³ÉΪW3CÍÆ¼öʹÓõıê×¼¡£
You can read more about XML standards in our W3C tutorial.
ÔÚW3C½Ì³ÌÖÐÄãÄÜ¿´µ½¸ü¶à¹ØÓÚXMLµÄ±ê×¼¡£
XML was designed to carry data
XMLÓÃÓÚ³ÐÔØÊý¾Ý
XML is not a replacement for HTML
XML²¢²»ÄÜ×÷ΪHTMLµÄÌæ´úÆ·
XML and HTML were designed with different goals
XMLºÍHTML¶¨ÒåµÄÄ¿µÄÊDz»Í¬µÄ
XML was designed to describe data and to focus on what data is
XMLÓÃÓÚÃèÊöÊý¾Ý£¬²àÖØÓÚÊý¾Ý±¾Éí£¨È磺Êý¾ÝÀàÐͺÍÊý¾Ý½á¹¹£©µÄ¶¨Òå
HTML was designed to display data and to focus on how data looks
HTMLÓÃÓÚÏÔʾÊý¾Ý£¬²àÖØÓÚÊý¾ÝµÄÏÔʾÐÎʽ
HTML is about displaying information, while XML is about describing information
HTML²àÖØÓÚÏÔʾÐÅÏ¢£¬¶øXMLÔò²àÖØÓÚÃèÊöÐÅÏ¢
XML was not designed to DO anything.
XMLÊDz»ÓÃÓÚ“¸ÉÊ”µÄ¡£
Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store and to send information.
¿ÉÄÜÕâô½âÊÍXMLÓеãÄÑÒÔÀí½â£¬µ«XMLȷʵ²»¸ÉÈκÎÊ£»XMLÖ»ÊÇÓÃÀ´¼Ü¹¹ÐÅÏ¢¡¢´¢´æÐÅÏ¢ÒÔ¼°·¢ËÍÐÅÏ¢µÄ¡£
The following example is a note to Tove from Jani, stored as XML:
ÏÂÃæµÄÀý×ÓÊÇÒÔXMLÐÎʽÊéдµÄÒ»ÕÅ Jani ¸ø Tove µÄ±ãÌõ£º
<note> |
The note has a header and a message body. It also has sender and receiver information. But still, this XML document does not DO anything. It is just pure information wrapped in XML tags. Someone must write a piece of software to send, receive or display it.
Õâ·Ý±ãÌõ°üº¬Á˱êÌâºÍÐÅÏ¢Ö÷Ì壬»¹°üº¬ÐÅÏ¢·¢ËÍÕߺͽÓÊÜÕßµÄÏà¹ØÐÅÏ¢¡£µ«ÔÚÕâÀÎÒÃÇ»¹ÊÇҪǿµ÷µÄÊÇ£ºXMLÎļþ²¢Î´×÷Èκδ¦Àí¡£ËüÖ»Êǽ«ÐÅϢǶÌ×ÔÚXML±êÇ©Àï¡£±ðÈ˱ØÐëÊéдһ¸öÖ¸Áî²ÅÄÜ·¢ËÍ¡¢½ÓÊÜ»òÏÔʾËü¡£
XML tags are not predefined. You must "invent" your own tags.
XML±êÇ©²»ÊÇÔ¤Ïȶ¨ÒåµÄ£¬Äã±ØÐëµÃ×Ô¼º“´´Ôì”±êÇ©¡£
The tags used to mark up HTML documents and the structure of HTML documents are predefined. The author of HTML documents can only use tags that are defined in the HTML standard (like <p>, <h1>, etc.).
ÓÃÓÚ±ê¼ÇHTMLÎĵµºÍHTMLÎĵµ½á¹¹µÄ±êÇ©ÊÇÔ¤Ïȶ¨ÒåºÃµÄ£¬HTMLÎĵµµÄÎĵµ×÷ÕßÖ»ÄÜʹÓÃHTMLÖÐÔ¤Ïȶ¨ÒåºÃµÄ±êÇ©¶ÔÎĵµ½øÐб༣¨Ïñ<p>, <h1>,µÈµÈ£©¡£
XML allows the author to define his own tags and his own document structure.
XMLÔÊÐí±àÕß×Ô¶¨Òå±êÇ©ºÍÎĵµ½á¹¹¡£
The tags in the example above (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document.
ÉÏÊöÀý×ÓÖÐʹÓõıêÇ©£¨Èç <to> ºÍ <from>£©²¢Î´ÔÚÈκÎXML±ê×¼Öж¨Ò壬ÕâЩ±êÇ©ÊÇXMLÎĵµ×÷Õß×Ô¼º“´´Ô씵ġ£
XML is not a replacement for HTML
XML²»Äܵ±×÷HTMLµÄÌæ´úÆ·¡£
It is important to understand that XML is not a replacement for HTML. In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data.
ÕâÀïÓÐÒ»µã·Ç³£ÖØÒª£ºXML²»ÊÇHTMLµÄÌæ´úÆ·¡£¼´Ê¹ÔÚ½«À´µÄ»¥ÁªÍøÖУ¬XMLÒ²ºÜ¿ÉÄÜÖ»ÓÃÓÚ¶¨ÒåÊý¾Ý£¬¶øHTMLÔòÓÃÓÚ¸ñʽ»¯Êý¾ÝºÍÏÔʾÊý¾Ý¡£
My best description of XML is this: XML is a cross-platform, software and hardware independent tool for transmitting information.
ÎÒÃǶÔXML×îºÃµÄ½âÊÍÊÇ£ºXMLÊÇ¿çÆ½Ì¨µÄ£¬ËüÊÇÒ»ÖÖ¶ÀÁ¢ÓÚÈíÓ²¼þµÄÊý¾Ý´«Ê乤¾ß¡£
XML is going to be everywhere
XML·¢Õ¹µ½ºóÃæ½«»áËæ´¦¿É¼û¡£
We have been participating in XML development since its creation. It has been amazing to see how quickly the XML standard has been developed and how quickly a large number of software vendors have adopted the standard.
×ÔXMLµ®ÉúÒÔÀ´£¬ÎÒÃǾÍÒѾ²ÎÓëµ½ËüµÄ·¢Õ¹¹ý³ÌÖ®ÖС£ÁîÈËÄÑÒÔÏëÏóµÄÊÇ£ºXML±ê×¼µÄ·¢Õ¹ÊÇÈç´ËѸËÙ£¬²¢ºÜ¿ì±»´óÅúµÄÈí¼þÉÌËù½ÓÄɺÍʹÓá£
We strongly believe that XML will be as important to the future of the Web as HTML has been to the foundation of the Web and that XML will be the most common tool for all data manipulation and data transmission.
ÎÒÃǼáÐÅ£¬XML¶ÔδÀ´ÍøÂçµÄÖØÒªÐÔ¾ö²»ÑÇÓÚµ±³õHTML¶ÔÍøÂç¼Ü¹¹µÄÖØÒªÐÔ£»²¢ÇÒ£¬XML½«³ÉΪÊý¾Ý´¦ÀíºÍÊý¾Ý´«ÊäÖÐ×îÆÕ±éʹÓõŤ¾ß¡£
Question: When should I use XML?
ÎÊ£ºÎÒ¸ÃʲôʱºòʹÓÃXMLÄØ?
Answer: When you need a buzzword in your resume.
´ð£ºµ±ÄãÏëÔÚÂÄÀú±íÖÐÇ¿µ÷ijЩ´ÊµÄʱºò¡£