Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

xml

¡¡¡¡XML£¨Extensible Markup Language£©¼´¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ£¬ËüÓëHTMLÒ»Ñù£¬¶¼ÊÇSGML(Standard Generalized Markup Language,±ê׼ͨÓñê¼ÇÓïÑÔ)¡£XmlÊÇInternet»·¾³Öпçƽ̨µÄ£¬ÒÀÀµÓÚÄÚÈݵļ¼Êõ£¬Êǵ±Ç°´¦Àí½á¹¹»¯ÎĵµÐÅÏ¢µÄÓÐÁ¦¹¤¾ß¡£À©Õ¹±ê¼ÇÓïÑÔXMLÊÇÒ»ÖÖ¼òµ¥µÄÊý¾Ý´æ´¢ÓïÑÔ£¬Ê¹ÓÃһϵÁмòµ¥µÄ±ê¼ÇÃèÊöÊý¾Ý£¬¶øÕâЩ±ê¼Ç¿ÉÒÔÓ÷½±ãµÄ·½Ê½½¨Á¢£¬ËäÈ»XMLÕ¼ÓõĿռä±È¶þ½øÖÆÊý¾ÝÒªÕ¼Óøü¶àµÄ¿Õ¼ä£¬µ«XML¼«Æä¼òµ¥Ò×ÓÚÕÆÎÕºÍʹÓá£
¡¡¡¡XMLʵÀý
¡¡¡¡<?xml version="1.0" encoding="ISO-8859-1"?>
¡¡¡¡<bookstore>
¡¡¡¡<book catalog="Programming">
¡¡¡¡<title lang="en">C++ Programming Language</title>
¡¡¡¡<author>Bjarne Stroustrup</author>
¡¡¡¡<year>1998</year>
¡¡¡¡<price>98.0</price>
¡¡¡¡</book>
¡¡¡¡<book catalog="Networking">
¡¡¡¡<title lang="en">TCP/IP Illustrated</title>
¡¡¡¡<author>Richard Stevens</author>
¡¡¡¡<year>1996</year>
¡¡¡¡<price>56.0</price>
¡¡¡¡</book>
¡¡¡¡</bookstore>
¡¡¡¡XMLÓëAccess,OracleºÍSQL ServerµÈÊý¾Ý¿â²»Í¬£¬Êý¾Ý¿âÌṩÁ˸üÇ¿ÓÐÁ¦µÄÊý¾Ý´æ´¢ºÍ·ÖÎöÄÜÁ¦£¬ÀýÈ磺Êý¾ÝË÷Òý¡¢ÅÅÐò¡¢²éÕÒ¡¢Ïà¹ØÒ»ÖÂÐԵȣ¬XML½ö½öÊÇչʾÊý¾Ý¡£ÊÂʵÉÏXMLÓëÆäËûÊý¾Ý±íÏÖÐÎʽ×î´óµÄ²»Í¬ÊÇ£ºËû¼«Æä¼òµ¥¡£ÕâÊÇÒ»¸ö¿´ÉÏÈ¥ÓеãËöϸµÄÓŵ㣬µ«ÕýÊÇÕâµãʹXMLÓëÖÚ²»Í¬¡£
¡¡¡¡XMLÓëHTMLµÄÉè¼ÆÇø±ðÊÇ£ºXMLÊÇÓÃÀ´´æ´¢Êý¾ÝµÄ£¬ÖØÔÚÊý¾Ý±¾Éí¡£¶øHTMLÊÇÓÃÀ´¶¨ÒåÊý¾ÝµÄ£¬ÖØÔÚÊý¾ÝµÄÏÔʾģʽ¡£
¡¡¡¡XMLµÄ¼òµ¥Ê¹ÆäÒ×ÓÚÔÚÈκÎÓ¦ÓóÌÐòÖжÁдÊý¾Ý£¬ÕâʹXMLºÜ¿ì³ÉΪÊý¾Ý½»»»µÄΨһ¹«¹²ÓïÑÔ£¬ËäÈ»²»Í¬µÄÓ¦ÓÃÈí¼þÒ²Ö§³ÖÆäËüµÄÊý¾Ý½»»»¸ñʽ£¬µ«²»¾ÃÖ®ºóËûÃǶ¼½«Ö§³ÖXML£¬ÄǾÍÒâζ×ųÌÐò¿ÉÒÔ¸üÈÝÒ×µÄÓëWindows¡¢Mac OS, LinuxÒÔ¼°ÆäËûƽ̨ϲúÉúµÄÐÅÏ¢½áºÏ£¬È»ºó¿ÉÒÔºÜÈÝÒ×¼ÓÔØXMLÊý¾Ýµ½³ÌÐòÖв¢·ÖÎöËû£¬²¢ÒÔXML¸ñʽÊä³ö½á¹û¡£
¡¡¡¡ÎªÁËʹµÃSGMLÏÔµÃÓû§ÓѺã¬XMLÖØж¨ÒåÁËSGMLµÄһЩÄÚ²¿ÖµºÍ²ÎÊý£¬È¥µôÁË´óÁ¿µÄºÜÉÙÓõ½µÄ¹¦ÄÜ£¬ÕâЩ·±ÔӵŦÄÜʹµÃSGMLÔÚÉè¼ÆÍøվʱÏԵø´ÔÓ»¯¡£XML±£ÁôÁËSGMLµÄ½á¹¹»¯¹¦ÄÜ£¬ÕâÑù¾ÍʹµÃÍøÕ¾Éè¼ÆÕß¿ÉÒÔ¶¨Òå×Ô¼ºµÄÎĵµÀàÐÍ£¬XMLͬʱҲÍƳöÒ»ÖÖÐÂÐÍÎĵµÀàÐÍ£¬Ê¹µÃ¿ª·¢ÕßÒ²¿ÉÒÔ²»±Ø¶¨ÒåÎĵµÀàÐÍ¡£
¡¡¡¡ÒòΪXMLÊÇW3CÖƶ¨µÄ£¬XMLµÄ±ê×¼»¯¹¤×÷ÓÉW3


Ïà¹ØÎĵµ£º

DOM4JÉú³ÉXMLÎĵµ


public int createXMLFile(String filename) {
  int returnValue = 0;
  Document document = DocumentHelper.createDocument();    //Éú³ÉDocument£¬ÓÃÓÚ¹ÜÀíXMLÎĵµ
  
  Element booksElement = document.addElement("books");    //Ìí¼Ó ......

.NET XML ´®Ðл¯½²×ù

1,dz´®Ðл¯£ºÖ»´®Ðл¯ÀàµÄ¹«¹²×ֶκÍÊôÐÔ
    ¹«¹²ÊôÐÔ±ØÐëÊǿɶÁÇÒ¿ÉдµÄ
    Ê¹ÓÃÃüÃû¿Õ¼ä£ºusing System.Xml.Serialization;
    ÒÔBookÀàΪÀý£º
    ´®Ðл¯Ä£°å£º
        public ......

XmlÖÐSelectSingleNode·½·¨ÖеÄxpathÓ÷¨

×î³£¼ûµÄXMLÊý¾ÝÀàÐÍÓУºElement, Attribute£¬Comment, Text.  
 
   Element, Ö¸ÐÎÈç<Name>Tom<Name>µÄ½Úµã¡£Ëü¿ÉÒÔ°üÀ¨£ºElement, Text, Comment, ProcessingInstruction, CDATA, and EntityReference.  
 
   Attribute, Ö¸ÔÚ<Employee >ÖеĴ ......

XMLÌØÊâ·û號

ÔÚweb.config×ö參數設¶¨時Óöµ½ÌØÊâ×ÖÔª value="http://www.yahoo.com.tw/default.aspx?sid=111111111&uid=test"
&uid這µØ·½會³ö錯...換³É&amp;uid ¾ÍOKÁË~~
幾個
對ÕÕÈçÏÂ:
< Сì¶
&lt;
> ´óì¶
&gt;
&
&amp ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ