XMLµÄ¼òµ¥¶ÁÈ¡ÓëдÈë
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
<price>5.95</price>
</book>
</bookstore>
1¡¢Íù<bookstore>½ÚµãÖвåÈëÒ»¸ö<book>½Úµã£º
XmlDocument xmlDoc=new XmlDocument();
xmlDoc.Load("bookstore.xml");
XmlNode root=xmlDoc.SelectSingleNode("bookstore");//²éÕÒ<bookstore>
XmlElement xe1=xmlDoc.CreateElement("book");//´´½¨Ò»¸ö<book>½Úµã
xe1.SetAttribute("genre","ÀîÔÞºì");//ÉèÖøýڵãgenreÊôÐÔ
xe1.SetAttribute("ISBN","2-3631-4");//ÉèÖøýڵãISBNÊôÐÔ
XmlElement xesub1=xmlDoc.CreateElement("title");
xesub1.InnerText="CS´ÓÈëÃŵ½¾«Í¨";//ÉèÖÃÎı¾½Úµã
xe1.AppendChild(xesub1);//Ìí¼Óµ½<book>½ÚµãÖÐ
XmlElement xesub2=xmlDoc.CreateElement("author");
xesub2.InnerText="ºò½Ý";
xe1.AppendChild(xesub2);
XmlElement xesub3=xmlDoc.CreateElement("price");
xesub3.InnerText="58.3";
xe1.AppendChild(xesub3);
root.AppendChild(xe1);//Ìí¼Óµ½<bookstore>½ÚµãÖÐ
xmlDoc.Save("bookstore.xml");
//===============================================
½á¹ûΪ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
<price>5.95</price>
</book>
<book genre="ÀîÔÞºì" ISBN="2-3631-4">
<title>CS´ÓÈëÃŵ½¾«Í¨</title>
<author>ºò½Ý</author>
<price>58.3</price>
</book>
</bookstore>
2¡¢Ð޸Ľڵ㣺½«genreÊôÐÔֵΪ“ÀîÔ޺쓵ĽڵãµÄgenreÖµ¸ÄΪ“updateÀîÔ޺씣¬½«¸Ã½ÚµãµÄ×Ó½Úµã<author>µÄÎı¾ÐÞ¸ÄΪ“ÑÇʤ”¡£
XmlNodeList nodeList=xmlDoc.SelectSingleNode("bookstore").ChildNodes;//»ñÈ¡bookstore½ÚµãµÄËùÓÐ×Ó½Úµã
foreach(XmlNode xn in nodeList)//±éÀúËùÓÐ×Ó½Úµã
{
XmlElement xe=(XmlElement)xn;//½«×Ó½ÚµãÀàÐÍת»»Îª
Ïà¹ØÎĵµ£º
²Î¿¼£º°Ù¶È°Ù¿Æ http://baike.baidu.com/view/1027076.htm?fr=ala0
ÔÚJDK 6.0ÖлùÓÚStAX·ÖÎöXMLÊý¾Ý£º http://hi.baidu.com/1shome/blog/item/5baaee01db2609051d958302.html
DOM¡¢SAX
¡¢DOM4J¡¢JDOM¡¢StAXÉú³ÉXML
²¢·µ»ØXML×Ö·û´®ÐÎʽ£ºhttp://dreams75.javaeye.com/blog/512319
STAX:Streaming API for XML (StAX)
......
ʹÓÃXML changeÐÞ¸ÄxmlÎļþµÄ»ù±¾²½Öè
(½öÏÞÓÚInstallscript MSIÏîÄ¿ÒÔ¼°Basic MSIÏîÄ¿)
1.µ¼ÈëXMLÎļþ¡£ÔÚSystem ConfigurationÊÔͼÖÐÑ¡ÔñXML File Changes£¬ÓÒ¼üXML
File¡£Ñ¡ÔñImport£¬¿ÉÒÔÆô¶¯Import XML
wizard¡£NextÖ®ºó£¬Ñ¡ÔñÐèÒªµ¼ÈëµÄXMLÎļþ£¨¿ÉÒÔÔÚÏÂÀ¿òÖÐÑ¡ÔñÀàÐÍ£©¡£NextÖ®ºó£¬Select
ALL¡£Èç¹ûÑ¡Ôñ²¿·Ö£ ......
¾³£»áÓõ½xmlÎļþ£¬ÄÚÈݼÓÔØ£¬ Èç¹ûʹÓÃlinq xmlÊ÷¼ÓÔØ£¬ÐèҪͨ¹ýXElementÀ࣬һÖÖ·½Ê½ÊÇÒÔ×Ö·û´®µÄÐÎʽ¼ÓÔØ£¬ÁíÍâÒ»ÖÖ·½Ê½ÊÇÒÔÎļþÐÎʽ¼ÓÔØ¡£ 1.ÒÔ×Ö·û´®ÐÎʽ¼ÓÔØ¡£ ÔÚXElementÀàÖУ¬Í¨¹ý¾²Ì¬µÄParse()·½·¨ ......
Internet Explorer 5.0 ¶Ô XML ÌṩÄĸö¼¶±ðµÄÖ§³Ö£¿
¡¡¡¡Internet Explorer 5 ÌṩÏÂÁÐ XML Ö§³Ö£º
¡¡¡¡Ö±½Ó²é¿´ XML¡£Microsoft XML ʵÏÖÔÊÐíÓû§Í¨¹ýËûÃÇµÄ Web ä¯ÀÀÆ÷ʹÓà XSL »òÕß²ãµþÑùʽ±í (CSS) ²é¿´ XML£¬¾ÍÏó²é¿´ HTML ÎĵµÒ»Ñù¡£
¡¡¡¡¸ßÐÔÄÜ¡¢ÑéÖ¤ XML ÒýÇæ¡£Internet Explorer 4.0 ¿ª·¢ÈËÔ±ÊìϤµÄ XML ÒýÇ ......
ÔÚ XML ¶ÔÏóÄ£ÐÍÖÐÈçºÎ´¦Àí¿Õ°××Ö·û£¿
¡¡¡¡ÓÐЩʱºò£¬XML ¶ÔÏóÄ£Ðͽ«ÏÔʾ°üº¬¿Õ°××Ö·ûµÄ TEXT ½Úµã¡£¿Õ°××Ö·û±»½Ø¶Ïºó£¬¶à°ë»á´øÀ´Ò»Ð©»ìÂÒ¡£ÀýÈçÏÂÃæµÄ XML Àý×Ó£º
¡¡¡¡]>
¡¡¡¡Smith
¡¡¡¡John
¡¡¡¡Éú³ÉÏÂÁÐÊ÷£º
¡¡¡¡Processing Instruction: xml
¡¡¡¡DocType: person
¡¡¡¡ELEMENT: person ......