c#Éú³ÉxmlÎļþÎÊÌâ - .NET¼¼Êõ / C#
<?xml version='1.0' encoding='UTF-8'?>
<tupian>
<tupian filename="a0.jpg" label="0É̵êÃûzi" url="http://www.baidu.com.cn" />
</tupian>
ÎÒÏëÓÃc#Éú³ÉÕâÖÖ¸ñʽµÄxmlÎļþ£¬Çë´óÏÀÃǰïæ£¡
ÎÒÏÖÔÚÖ»ÄÜÉú³É <tupian filename="a0.jpg"/> ÕâÖÖ¸ñʽµÄ£¬tupian±êÇ©ÀïÖ»ÓÐÒ»Ï
ÌùÒ»µãÄãµÄ´úÂë¡£¡£¡£
ÕâЩÊý¾ÝÍêÈ«ÊÖдµÄ»¹ÊÇ´ÓÄÄ»ñÈ¡µÄ£¿
¿ÉÒԲο¼Ò»ÏÂÕâ¸ö
C# code:
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.NewLineOnAttributes = true;
XmlWriter writer = XmlWriter.Create("e:\\bppknew.xml", settings);
writer.WriteStartDocument();
writer.WriteStartElement("book");
writer.WriteAttributeString("gnere", "Mystery");
writer.WriteAttributeString("publicationdate", "2001");
Ïà¹ØÎÊ´ð£º
ÈçÌ⣬C/C++ÖеÄexeclÔõôµ÷ÓÃдºÃµÄjava³ÌÐò£¬
execl("/opt/java1.5/bin/java","MyClass",NULL);
ÕâÑùµÄ²»ÐÐŶ¡£
²»»á.
ÔËÐÐjava³ÌÐò
ÕÒ¹¤¾ß²é¿´Ò»ÏÂÄǸö³ÌÐòµÄÃüÁîÐÐ
ËÑË÷Ï£ºjni ......
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
<?xml version="1.0" encoding="utf-8" ?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......
ÎÒÓÐÒ»¸öÀàËÆµÄxmlµÄ string£¬Ïëͨ¹ý±éÀúÔõô¸öxml Êä³öÎÒÏëÒªµÄelementµÄÖµ
xml Ϊ£º
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_XML_ME ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......