NET ¶Á¡¢Ð´¡¢²é¡¢É¾¡¢¸ÄXMLÎļþ
.NET¶Á¡¢Ð´¡¢²é¡¢É¾¡¢¸ÄXMLÎļþ
Ò»¡¢
XML
¼ò½é
XML
¼´¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ£¨
EXtensible Markup Language
£©£¬ÊÇÒ»ÖÖ±ê¼ÇÓïÑÔ£¬ºÜÀàËÆ
HTML
¡£
XML
µÄÉè¼Æ×ÚÖ¼ÊÇ´«ÊäÊý¾Ý£¬¶ø·ÇÏÔʾÊý¾Ý¡£
XML
±êǩûÓб»Ô¤¶¨Ò壬ÐèÒªÓû§¶¨Òå±êÇ©¡£
XML
±»Éè¼ÆÎª¾ßÓÐ×ÔÎÒÃèÊöÐÔ²¢·ûºÏ
W3C
µÄÍÆ¼ö±ê×¼¡£
XML
ÒѾ±»¹ã·ºµÄÓ¦ÓÃÓÚÈí¼þ¿ª·¢µÄºÜ¶à·½Ãæ£¬ÌØ±ðÊÇ
Web
¿ª·¢¡£³£ÓÃÓÚ¼ò»¯Êý¾ÝµÄ´æ´¢ºÍ¹²Ïí¡£
¶þ¡¢
XML
Óï·¨
1£©
¿ÉÒÔ¸ù¾ÝÓ¦ÓñàдÓÐʵ¼ÊÒâÒåµÄ±êÇ©
±ÈÈçÒªÃèÊö°à¼¶¿ÉÒÔ¶¨Òå
<Class>
±êÇ©£¬ÒªÃèÊöѧÉú¿ÉÒÔ¶¨Òå
<Student>
±êÇ©¡£
2£©
ËùÓÐ
XML
±êÇ©±ØÐë
ÓйرձêÇ©£¬È磺
<Class>
¸ßÈýÒ»°à
</Class>
</Class>
ÊǹرձêÇ©£»ÔÙÈ磺
<Student>
¸ßÈýÒ»°à
</Student>
</Student>
ÊǹرձêÇ©¡£
3£©
XML
±êǩҲÊÇÇø·Ö´óСдµÄ£º
<Class>
¸ßÈýÒ»°à
</class>
ÉÏÃæÐ´·¨ÊÇ´íÎóµÄ£¬ÒòΪ
<Class>
ºÍ
</class>
ÊDz»Í¬µÄ±êÇ©£¬
</class>
ÊÇ
<class>
µÄ¹Ø±Õ±êÇ©£¬¶ø²»ÊÇ
<Class>
µÄ¹Ø±Õ±êÇ©¡£
3
£©
XML
±êÇ©ÊÇ¿ÉÒÔǶÌ׵쬶øÇÒ±ØÐëÕýȷǶÌ×£¬ËùνǶÌ×Ò²¾ÍÊÇÔÚÆäÄÚµÄÒâ˼£¬°ÑÎÕÕâÒ»µã¾Í²»ÄÑ¿´³öÒ»ÏÂÄĸöÊÇ´íÎóµÄÁË£¬ÕýÈ·µÄд·¨ÈçÏ£º
<Class>
<Student>
</Student>
</Class>
´íÎóµÄд·¨£º
<Class>
<Student>
</Class>
</Student>
ÔÚ±àд
XML
´úÂëʱ£¬×¢Òâ±£³ÖÇåÎúµØ²ã´Î½á¹¹¡£
4£©
XML
±ØÐëÓиùÔªËØ£¬¸ùÔªËØÓÐÇÒÖ»ÄÜÓÐÒ»¸ö
<Root>
<Child>1</Child>
<Child>2</Child>
<Child>3</Child>
</Root>
5£©
¿ÉÒÔ¸ø
XML
±êÇ©¶¨ÒåÊôÐÔ£¬ÊôÐÔÖµ±ØÐë·ÅÔÚÓ¢Îİë½ÇË«ÒýºÅÀïÃæ¡£
<Class Name=”
¸ßÈýÒ»°à
”>
<Student>
</Student>
</Class>
ÏÂÃæÊôÐÔÊÇ´íÎóµÄ£º
<Class Name=
¸ßÈýÒ»°à
&g
Ïà¹ØÎĵµ£º
function $import(path,type,title,idname){
var s,i;
if(type=="js"){
&nb ......
½âÎö£º
CMarkup xml;
CString strChanText, strChanType;
xml.Load("MyXml.xml");
xml.ResetMainPos();
if (!Chan.FindElem("TreeOrg"))
{
return;
}
if (xml.IntoElem())
{
xml.FindEle ......
³ö´¦£ºhttp://www.dimuthu.org/blog/2008/08/18/xml-schema-nillabletrue-vs-minoccurs0/
¡¾Ç°ÑÔ¡¿Ò»¸öÔÂǰÑо¿¹ýnillable="true"ºÍ vs minOccurs="0"µÄÇø·Ö£¬Ã»ÓÐÏëµ½°¡£¬½ñÌì¾Í¼Ç²»µÃÁË£¬¿´À´ÕæÊǺüÇÐÔ²»ÈçÀñÊÍ·°¡£¬¿öÇÒÎÒ»¹Ã´µÄºÃ¼ÇÐÔ¡£¡£¡£¡£
¡¾×ܽ᡿ӢÎÄÒ»ÑÛ¿´²»³ö½áÂÛ£¬ËµµãººÓïÖ±½ÓЩ£¬±ð˵ÎÒÍÁ¹þ~
nillable=" ......
XML ÔªËØ
ÔªËØÃüÃû
XMLÔªËØ±ØÐë×ñÊØÒÔϵÄÃüÃû¹æÔò£º
Ãû×ֿɰüº¬×Öĸ¡¢Êý×ÖÒÔ¼°ÆäËûµÄ×Ö·û
Ãû×Ö²»ÄÜÒÔÊý×Ö»òÕß±êµã·ûºÅ¿ªÊ¼
Ãû×Ö²»ÄÜÒÔ×Ö·û“xml”£¨»òÕßXML¡¢Xml£©¿ªÊ¼
Ãû×Ö²»Äܰüº¬¿Õ¸ñ
µ±Äú“·¢Ã÷´´Ôì”ÔªËØÃû³ÆÊ±£¬ÇëÁôÒâ²¢×ñÑÏÂÃæµÄ¼òµ¥µÄ¹æÔò£º
Äú¿ÉÒÔʹÓóý±£Áô×ÖÍâµÄÈκÎÃû³Æ£ ......
¹ØÓÚ°²×°multiget³öÏÖXML::Parser perl module is required for intltool´íÎóÎÊÌâµÄ½â¾ö ÊÕ²Ø
ÔÚ°²×°Multiget£¬ÔÚconfigureµÄʱºòÌáʾXML::Parser perl module is required for intltool´íÎó¡£¾ßÌå½â¾öµÄ·½·¨ÈçÏ£º #perl -MCPAN -e shell Ö®ºó¸ú¾ÝÌáʾһ²½²½ÍùÏ£¬ÅäÖÃÍêºó»á³öÏÖÒ»¸ö >µÄÃüÁîÌáʾ >install ......