ÈçºÎÑ»·Ð´ÈëxmlÎļþ£¬´úÂëÈçÏ¡£
C# code:
XmlDocument doc = new XmlDocument();
for (int i = 0; i < so.Length; i++)
{
doc.LoadXml("<xlstablecol>" + "<columnid>" + i + "</columnid>" + " <columnname>" + dr.GetName(i) + " </columnname>" + "<columncnname>" + so[i] + "</columncnname>" + "</xlstablecol>");
}
doc.Save("e:\\Info.xml");
ÏÖÔÚÿ´ÎµÄдµÄ×Ô¶¯¸²¸ÇÁËÉÏÒ»´Î£¬Õâ¸ö¸ÃÔõô¸Ä£¬Èç¹ûÓÐÆäËû·½·¨´ó¼Ò¸æÎÒһϣ¬ÔÚÏߵȡ£
XmlDocument doc = new XmlDocument("e:\\Info.xml¡°);
for (int i = 0; i < so.Length; i++)
{
doc.LoadXml(" <xlstablecol>" + " <columnid>" + i + " </columnid>" + " <columnname>" + dr.GetName(i) + " </columnname>" + " <columncnname>" + so[i] + " </columncnname>" + " </xlstablecol>");
}
doc.Save("e:\\Info.xml");
ÄãÓÖ²
Ïà¹ØÎÊ´ð£º
ÎÒÔÚʹÓÃDom¶ÁxmlÎļþʱÓöµ½Ò»¸öÎÊÌ⣬¾ÍÊǵ±123.xmlÎļþ²»´æÔÚʱ£¬load(123.xml)¾Í±¨´í£¬ÔõôÑù²ÅÄÜÅжÏÕâ¸öÎļþÊÇ·ñ´æÔÚ°¡£¬ÎÒÒªµÄÊÇ´æÔÚʱ¾Í¶ÁÈ¡£¬²»´æÔÚ¾ÍÌø¹ý£¬¼ÌÐøµÄ¶ÁÏÂÒ»¸öxml£¬Çë½Ì¸÷λ´óÏÀ£¬
$file ......
ÇóÖú¸÷λ´óϺ£¬Ñ§Éú³É¼¨µ¥XML SchemaµÄÉè¼Æ,XMLÎĵµµÄÉè¼Æ£¬°üº¬µÄÖ÷ÒªÐÅÏ¢£ºÑ§ºÅ¡¢Ñ§ÉúÐÕÃû¡¢Ïµ²¿¡¢°à¼¶¡¢¿¼ÊÔÈÕÆÚ¡¢ÈονÌʦ¡¢Ñ§·Ö¡¢Ñ§Ê±¡¢ÐÞϰÀà±ð¡¢Java³ÌÐòÉè¼Æ³É¼¨,ÍøÂç»ù´¡ÖªÊ¶³É¼¨¡¢ÍøÒ³ÖÆ×÷³É¼¨¡¢Èí¼þ¹¤³Ì³ ......
ÈçÌ⣬ÓÐûÓÐÕâÑùµÄphp´úÂë¡£ÎÒÏÖÔÚÏ뽫excelµÄÄÚÈݲåÈëmysqlÊý¾Ý¿â£¬Ï£Íû¿ÉÒÔ½«excelת³Éxml,È»ºó½âÎöxml²åÈëÊý¾Ý¿âÖС£Èç¹ûÓÐÕâÑùµÄ´úÂ룬ÉõÖÁÊÇÓÐÃûµÄ´úÂ룬һ¶¨Òª¸æËßÎÒ°¡¡£
ÏȶÁ excel => È»ºóÉú³É xml = ......
ÈçºÎ¶ÔxmlÄÚÈÝÊý¾Ý½øÐбȽÏ
ÀýÈ磺
<?xml version='1.0' encoding='utf-8'?>
<TestLIST>
<PID>40</PID>
<TestName>ÉîÛÚÊÐ</TestName>
......
<XML>
<FLAG>1</FLAG>
<REASON></REASON>
<ADVERT><ADID>64</ADID><ADNAME>Ó¢»ÊÓéÀÖËÄ</ADNAME><ADCONTENT>ÄÚÈÝÒ»</ADCONTENT><ADT ......