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

´úÂëÐÞ¸ÄXML±êÇ©

Ò»¡¢ÎÊÌâÃèÊö£º
Ò»¸öXMLÎĵµ£¬ÃûΪOriginXml.xml£¬Ê¾ÀýÊý¾ÝÈçÏ£º
 <?xml version="1.0" encoding="utf-8"?>
<Class>
<student id="2001001">
<name>ÕÅÈý</name>
<age>18</age>
<scores>
<ÓïÎÄ>79</ÓïÎÄ>
<Êýѧ>90</Êýѧ>
</scores>
</student>
<student id="2001002">
<name>ÀîËÄ</name>
<age>20</age>
<scores>
<ÓïÎÄ>88</ÓïÎÄ>
<Êýѧ>64</Êýѧ>
</scores>
</student>
</Class>
  
 
ÏÖÐèÒªÔÚÁ½¸öÎĵµ¼äת»»£¬ÐèÒª½«±êÇ©studentÐÞ¸ÄΪ<pStudent>,ÆäÓà×ÓÔªËر£³Ö²»±ä£¬Ð޸ĵÄÎĵµ´æÈëModifyXML.xmlÖС£
 
¶þ¡¢ÎÊÌâ·ÖÎö
    Ð޸ıêÇ©Ãû³Æ£¬ÊµÖÊÉÏÊǶÔÔªËØÖØÃüÃû¡£ÔªËØÔÚDTD»òXML SchemaÖж¨Ò壬Òò´ËÐÞ¸ÄÔªËØÃû³Æ±ØÐëÐÞ¸ÄDTD»òXML Schema£¬·ñÔòÐ޸ĺóµÄÎĵµ²»ÊÇ“Êý¾ÝÓÐЧ”µÄ¡£Èç¹ûûÓÐDTD»òXML SchemaµÄÇé¿öÏ£¬ÔòÒª¼òµ¥Ò»Ð©¡£¿ÉÒÔÖ±½ÓÐ޸ĻòÔÚDOMÄ£ÐÍÖÐÐ޸ġ£
    Ö±½ÓÐ޸ľÍÊǽ«XMLÎĵµÊÓΪÆÕͨµÄÎı¾Á÷£¬¶ÁÈëºóÖ±½Ó½øÐÐ×Ö·û´®Ìæ»»²Ù×÷¡£µ«ÊÇ£¬Èç¹ûÄÚǶDTD»òXML Schema¶¨Ò壬Ôò²»¿ÉÖ±½ÓÌæ»»¡£Ìæ»»¹ý³ÌÖУ¬Èç¹ûÔªËؾßÓÐÏÞ¶¨Ãû³Æ£¬Ôò×îºÃʹÓÃÕýÔò±í´ïʽ²éÕÒ¡¢Ìæ»»¡£
    DOMÄ£ÐÍÐÞ¸ÄÊÇͨ¹ý¶ÁÈëXMLÎĵµºó£¬¸ù¾ÝÒªÇó½âÎö²¢Öع¹½Úµã¡£Ïà¶ÔÓÚSAXÀ´Ëµ£¬DOMÊǿɱ༭µÄ£¬µ«²¢²»Òâζ׎ڵãÃû³Æ¿É¸ü¸Ä¡£Ò»µ©´´½¨½Úµãºó£¬Ãû³Æ¼´²»¿ÉÐ޸ġ£ËùÒÔÖ»ÄÜ´´½¨Ð½ڵ㣬½«Ô­Óнڵ㸴ÖƹýÈ¥²¢×÷±ØÒªµÄÐ޸ģ¬×îºóÌæ»»½Úµã¡£
Èý¡¢½â¾öÎÊÌâ
    ÒÔÏÂÃèÊöÁ˼ٶ¨Ã»ÓÐDTDºÍXML SchemaµÄÇé¿öÏ£¬ÐÞ¸ÄÔªËرêÇ©µÄÁ½ÖÖ·½·¨ 
£¨Ò»£©Ö±½ÓÐÞ¸Ä
´úÂëÈçÏ£º
StreamReader sr = new StreamReader("OriginXml.xml");
string str = sr.ReadToEnd();
sr.Close();
str=str.Replace("student", "pStudent");
//Èç¹ûÓÐÏÞ¶¨Ãû³Æ£¬×îºÃÓÃÕýÔò±í´ïʽ²éѯ¡¢Ìæ»»
StreamWriter sw = new StreamWriter("ModifyXml.xml");
sw.Write(str);
sw.Flush(); sw.Close();


£¨¶þ£©Ê¹ÓÃDOMÄ£ÐÍÐÞ¸Ä
XmlDocument doc = new XmlDocument();
doc.Load("OriginXml.xml");
XmlElement oldEleme


Ïà¹ØÎĵµ£º

J2MEÖÐKXMLÓëNanoXML½âÎöXML×ܽá

ÔÚJ2MEÌåϵÖУ¬¶ÔxmlµÄ½âÎöÓбȽÏÓÐÃûµÄµÚÈý·½½âÎöAPI£¬·Ö±ðΪKXMLºÍNanoXML£¬ËûÃǶ¼ÌṩÁ˶ԽâÎöxmlµÄÖ§³Ö¡£KXMLÔÚ½âÎöXML¹ý³ÌÖлá¶ÔÎļþÄÚÈÝÒ»²ãÒ»²ã½øÐнâÎö£¬Òò´Ë³ÉΪÔöÁ¿Ê½½âÎöÆ÷£¬±È½ÏÊʺϴóÎļþµÄ½âÎö¡£¶øNanoXMLÊÇÒ»´ÎÐÔ½âÎöÆ÷£¬ÔÚÒ»´Îʱ¼äÀï¾Í°ÑÕû¸öxmlÎĵµ½âÎöÍ꣬Òò´Ë²»ÊʺϴóÎļþµÄ½âÎö£¬»áÔì³ÉÄÚ´æ²»×ãµÄÏÖÏó¡ ......

web±à³Ì XMLÎļþ¸ñʽ

Ò»¸öxmlÎļþµÄÀý×Ó¡¡¡¡ÏÖÔÚÎÒÃÇÔÝÇÒʹÓÓ¼Çʱ¾”À´´´½¨ÎÒÃǵÄxmlÎļþ°É¡£ÏÈ¿´Ò»¸öxmlÎļþ£º
¡¡¡¡Àý1
¡¡¡¡——————————————————————
¡¡¡¡¡´?xml version="1.0" encodin ......

dom4j¶Ôxml±È½ÏÍêÕûµÄ²Ù×÷

×î½üдµÄ²å¼þÓõ½ÁËdom4j£¬À´¶Áд£¬ÐÞ¸ÄÎĵµ¡£Óõ½µÄ¹¦Äܶ¼Ð´³öÀ´ÁË
ÏÂÃæ°üº¬ÁËÁ½¸ö³ÌÐò WriteFriendsInfo£¬ºÍ ReadFriendsInfo¡£
1.WriteFriendsInfo °üº¬ÁËн¨xmlºÍÐ޸ģ¬É¾³ýxml½ÚµãµÄ·½·¨
 Ò»Ð©Òªµã£º
    WriteFriendsInfo ÖÐÐ޸Ľڵã²ÉÓõķ½Ê½ÊÇɾ³ý½Úµã£¬È»ºó°ÑеĽڵãд½øÈ¥¡£ÔÚ²»¶Ô¶Á ......

VC¶ÁдXMLÎļþ


½ñÌì¶ÔXMLÎļþ½øÐÐÁËһЩ¼òµ¥µÄ¶Áд²Ù×÷£¬ÏÂÃæÀ´¾ßÌåʵÏÖ²½Ö裺
Ê×ÏÈ£º½¨Á¢Ò»¸ö»ùÓÚDialogµÄMFC¹¤³Ì£¬¹¤³ÌÃûΪOperateXML£¬È»ºóÔÚ¶Ô»°¿òÉÏÌí¼ÓÁ½¸ö°´Å¥("Create"ºÍ"GetData"ºÍÒ»¸öListControl
¿Ø¼þ(ÓÃÀ´ÏÔʾÊý¾Ý)£¬Ê×ÏÈÒªµ¼Èë¿âÎļþ
#import "msxml3.dll"
using namespace MSXML2;
Ö÷ÒªÓÃÀ´ÊµÏÖXMLÎļþµÄÏà¹Ø²Ù×÷£¬ ......

XMLÖк¬ÓÐhtml±êÇ©µÄÎÊÌâ

¿´½áÂÛÇëÖ±½Ó¿´ÏÂÃæ
½ñÌìдÉú³ÉxmlµÄphp¡£Ã»ÓÐÓÃʲôXMLDOMNodeÖ®ÀàµÄÀ´Éú³É£¬¶øÊÇÖ±½Óecho³öxmlµÄÄÚÈÝ¡£
xmlµÄÄÚÈÝÖÐÓÐÒ»²¿·ÖµÄÊý¾ÝÊÇ´ÓdbÖÐÑ­»·È¡³öµÄ£¬ÎÊÌâ¾Í³öÔÚÕâ¡£ÎÒ·¢ÏÖÈ«²¿È¡³öÊý¾Ýʱ£¬¶ÔÓÚÉú³ÉµÄxml£¬simplexml_load_string·µ»Øfalse£¬¼´±íÃ÷Éú³ÉµÄxmlÊÇ·Ç·¨µÄ¡£
debugһϣ¬·¢ÏÖÈ¡³öÊý¾Ý¼ÓÒÔÏÞÖÆ limit 8 һϠ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ