XML ÊôÐÔvsÔªËØ
Çë¿´ÏÂÃæµÄʾÀý£º
<person sex="female">
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person>
<person>
<sex>female</sex>
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person>
ÔÚµÚÒ»¸öÀý×ÓÖУ¬sex ÊÇÒ»¸öÊôÐÔ¡£ÔÚµÚ¶þ¸öÀý×ÓÖУ¬sex ÔòÊÇÒ»¸ö×ÓÔªËØ¡£Á½¸öÀý×Ó¾ù¿ÉÌṩÏàͬµÄÐÅÏ¢¡£
ûÓÐʲô¹æ¾Ø¿ÉÒÔ¸æËßÎÒÃÇʲôʱºò¸ÃʹÓÃÊôÐÔ£¬¶øʲôʱºò¸ÃʹÓÃ×ÓÔªËØ¡£ÎҵľÑéÊÇÔÚ HTML ÖУ¬ÊôÐÔÓÃÆðÀ´ºÜ±ãÀû£¬µ«ÊÇÔÚ XML ÖУ¬ÄúÓ¦¸Ã¾¡Á¿±ÜÃâʹÓÃÊôÐÔ¡£Èç¹ûÐÅÏ¢¸Ð¾õÆðÀ´ºÜÏñÊý¾Ý£¬ÄÇôÇëʹÓÃ×ÓÔªËØ°É¡£
ÒòʹÓÃÊôÐÔ¶øÒýÆðµÄһЩÎÊÌ⣺
ÊôÐÔÎÞ·¨°üº¬¶à¸öÖµ£¨×ÓÔªËØ¿ÉÒÔ£©
ÊôÐÔÎÞ·¨ÃèÊöÊ÷½á¹¹£¨×ÓÔªËØ¿ÉÒÔ£©
ÊôÐÔ²»Ò×À©Õ¹£¨ÎªÎ´À´µÄ±ä»¯£©
ÊôÐÔÄÑÒÔÔĶÁºÍά»¤
Ç뾡Á¿Ê¹ÓÃÔªËØÀ´ÃèÊöÊý¾Ý¡£¶ø½ö½öʹÓÃÊôÐÔÀ´ÌṩÓëÊý¾ÝÎ޹صÄÐÅÏ¢¡£
ÔªÊý¾Ý£¨ÓйØÊý¾ÝµÄÊý¾Ý£©Ó¦µ±´æ´¢ÎªÊôÐÔ£¬¶øÊý¾Ý±¾ÉíÓ¦µ±´æ´¢ÎªÔªËØ¡£
Ïà¹ØÎĵµ£º
¶ÔÓÚ.NETµ½µ×ÊÇʲôÕâ¸öÎÊÌ⣬ÓÐן÷ÖÖ¸÷ÑùµÄ˵·¨¡£µ«µ±Ê±×÷ΪÊ×ϯִÐйٵı«¶ûĬӦ¸Ã×îÄÜ´ú±í΢Èí¹«Ë¾µÄ¹Û
µã£¬Ëû˵£º“Microsoft.NET ´ú±íÁËÒ»¸ö¼¯ºÏ¡¢Ò»¸ö»·¾³¡¢Ò»¸ö¿ÉÒÔ×÷Ϊƽ̨֧³ÖÏÂÒ»´úInternetµÄ¿É±à³Ì½á¹¹¡£”È·
ʵ£¬Õâ¾ä»°»ù±¾Éϼòµ¥¶óÒªµØ±íÊöÁË.NETµÄÍâÌØÐÔ¡£
.NETÊ×ÏÈÊÇÒ»¸ö»·¾³¡ ......
¼òµ¥µÄÀ࣬¼ò»¯×Ô¼º¶ÁÈ¡xmlµÄ¹ý³Ì
ReadXML.as
package
{
import flash.display.Sprite;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.system.System;
import flash.events.EventDis ......
XMLÎļþµÄ½âÎö££libxml¿âº¯Êý½âÊÍ[ת]
libxml£¨Ò»£©
ÕªÒª
LibxmlÊÇÒ»¸öÓÐÃâ·ÑÐí¿ÉµÄÓÃÓÚ´¦ÀíXML¡¢¿ÉÒÔÇáËÉ¿çÔ½¶à¸öƽ ......
Create:
int nFQ;
XmlDocument doc = new XmlDocument();
XmlAttribute
newAtt;
//¶¨ÒåXMLÎĵµÍ·Îļþ
XmlDeclaration dec =
doc.CreateXmlDeclaration("1.0",null,null);
doc.AppendChild(dec);
&n ......
¾³£¼ûXMLÐòÁл¯µÄÎÄÕ£¬¶Ô¸ÃÐòÁл¯·½Ê½²¢²»ÊÇÌ«ÏþµÃ£¬¿´ÁËMSDNºÍһЩ×ÊÁϺóÓÐÁË´óÖµÄÁ˽⣬´óµÀÀí½²²»³öÀ´£¬ÉÏ ´úÂëÏÈ£º
·½Ê½Ò» ͨ¹ýXmlSerializeÖ±½ÓÐòÁл¯£º
Class BeSerialized
{
//ij×Ö¶Î
public int someFiled;
//¹«¹²ÀàµÄÒ»¸ö¿ÉÐòÁл¯µÄÊôÐÔ
private bool serialme;
public bool SerialMe
{
......