C#¶ÔxmlµÄ²Ù×÷ʵÀýÔ´Âë
À©Õ¹±ê¼ÇÓïÑÔXML£¨eXtensible Markup Language£©£¬ÊÇÓÉW3C×éÖ¯Öƶ¨µÄ¡£×öΪÓÃÓÚÌæ´úHTMLÓïÑÔµÄÒ»ÖÖÐÂÐ͵ıê¼ÇÓïÑÔ£¬XMLÄÚ²¿ÓÐןܶà»ù±¾±ê×¼£¬XML¾ÍÊÇͨ¹ýÓëÕâЩÏà¹Ø±ê×¼µØ½áºÏ£¬Ó¦ÓÃÓÚ¿Æѧ¼ÆËã¡¢µç×Ó³ö°æ¡¢¶àýÌåÖÆ×÷ºÍµç×ÓÉÌÎñµÄ¡£C££×÷ΪһÖÖÐÂÐ͵ijÌÐòÓïÑÔ£¬ÊÇ.Net¿ò¼ÜµÄÒ»¸öÖØÒª×é³É²¿·Ö£¬ËûºÍXMLµÄ¹ØϵÆÄÉî¡£±¾ÎľʹÓÒ»¸ö·½ÃæÀ´Ì½ÌÖÒ»ÏÂÕâ¶þÕߵĹØϵ¡£¼´£º¿´ÓÃC££ÈçºÎÀ´´´½¨ºÍ¶ÁÈ¡XMLÎĵµ¡£
Ò»£® ±¾ÎijÌÐòÉè¼ÆºÍÔËÐеÄÈí¼þ»·¾³£º
£¨Ò»£©.΢Èí¹«Ë¾ÊÓ´°2000·þÎñÆ÷°æ
£¨¶þ£©..Net FrameWork SDK Beta 2
¶þ£® C££´´½¨XMLÎĵµ£º
ÔÚ±¾ÎÄÖÐÎÒÃÇÀ´½éÉÜÒ»ÏÂÓÃC££´´½¨XMLÎĵµµÄ¶þÖÖ·½·¨£¬Õâ¶þÖÖ·½·¨¸÷ÓÐǧÇµÚÒ»ÖÖ´´½¨ÆðÀ´¸üÁé»î£¬µÚ¶þÖÖ´´½¨ÆðÀ´¸ü·½±ã¡£
£¨Ò»£©.C££´´½¨XMLÎĵµµÄµÚÒ»ÖÖ·½·¨£º
ÕâÒ»ÖÖ·½·¨ÊÇ°´ÕÕ°´ÕÕXMLµÄ½á¹¹Ò»²½Ò»²½µÄ¹¹½¨XMLÎĵµ¡£C££¹¹½¨XMLÎĵµÍ¨¹ý.Net FrameWork SDKÖеÄÃüÃû¿Õ¼ä"System.Xml"Öзâ×°µÄ¸÷ÖÖÀàÀ´ÊµÏֵġ£ÏÂÃæ¾Í°´ÕÕÒ»¸öXMLµäÐÍÎĵµ½á¹¹À´½éÉÜһϡ£
£¨1£©.Ê×ÏÈÒª´´½¨Ò»¸ö¿ÕµÄXMLÎĵµ£º
ÔÚÃüÃû¿Õ¼ä"System.Xml"ÖÐÓÐÒ»¸öÀà"XmlDocument"£¬C££Í¨¹ýÕâ¸öÀàÀ´ÃèÊöXMLÎĵµ¡£ÏÂÃæÊÇÓÃC££´´½¨Ò»¸öXMLÎĵµ¡£
xmldoc = new System.Xml.XmlDocument ( ) ;
£¨2£©.ÔÚXMLµÄÎĵµµÄ×îÍ·²¿¼ÓÈëXMLµÄÉùÃ÷¶ÎÂ䣺
ÀûÓÃ"XmlDocument"ÀàÖÐµÄ "CreateNode" ·½·¨¿ÉÒÔ´´½¨Ò»¸öÖ¸¶¨ÀàÐ͵ÄXML½Úµã£¬"CreateNode" ·½·¨µÄµ÷Ó÷½·¨×ܹ²ÓÐÈýÖÖ£¬ÔÚ±¾ÎÄÖÐʹÓõÄÆäÒ»°ãµÄ·½·¨£¬¾ßÌåÓï·¨ÈçÏ£º
XmlDocument.CreateNode Method ( XmlNodeType , String , String )
È»ºóÔÚÀûÓÃ"XmlDocument"ÀàÖеÄ"AppendChild"·½·¨ÔÚXMLÎĵµÖмÓÈë´Ë½Úµã£¬ÓÃC££ÔÚXMLÎĵµÖмÓÈëÉùÃ÷¶ÎÂäʵÏÖµÄÓï¾äÈçÏ£º
xmlnode = xmldoc.CreateNode ( XmlNodeType.XmlDeclaration , "" , "" ) ;
xmldoc.AppendChild ( xmlnode ) ;
£¨3£©.ΪXMLÎĵµ¼ÓÈëÔªËØ£¨element£©£º
¼ÓÈëÊý¾ÝÄÚÈÝÊÇͨ¹ýÔªËØ£¬ÔÚ"XmlDocument"ÀàÖÐÌṩÁ˶þ¸ö·½·¨£º"CreateElement"ºÍ"CreateTextNode"¡£ÆäÖеÚÒ»¸ö·½·¨ÊÇÔÚXMLÖд´½¨Ò»¸öÔªËØ£¬ÁíÍâÒ»¸ö·½·¨ÊÇΪ´´½¨µÄÔªËØÖ¸¶¨Îı¾Öµ¡£ÏÂÃæÊÇΪÉÏÃæ´´½¨µÄXMLÎĵµ¼ÓÈëÒ»¸ö¸ùÔªËØ¡£
xmlelem = xmldoc.CreateElement ( "" , "ROOT" , "" ) ;
xmltext = xmldoc.CreateTextNode ( "Root Text" ) ;
×¢ÊÍ£ºÆäÖÐ"xmlelem"ÊÇ´´½¨µÄ"XmlElement"¶ÔÏó£¬"xmltext"ÊÇ"XmlText"¶ÔÏó
ÓÐÁË´´½¨Ò»¸öXMLÔªËصÄÀý×Ó£¬¾Í¿ÉÒÔ¸ù¾ÝXMLÎĵµÖ
Ïà¹ØÎĵµ£º
µ±ÊäÈë ¡·Ê±×Ô¶¯²¹È« µ±ÊäÈ롶/ʱ×Ô¶¯²¹È«
“£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
" File: closetag.vim
" Summary: Functions and mappings to close open HTML/XML tags
" Uses: <C-_> -- close matching open tag
" Author: Steven Mueller <di ......
×î½ü×öµÄÒ»¸öÏîÄ¿ÖÐÔËÓà xml Êý¾Ýµº¼¼Êõ£¬ËùÒÔ°ÑÊý¾Ýµº·½ÃæµÄ֪ʶ×ܽáһϡ£
XML Êý¾Ýµº £¨ data islands £©¾ÍÊDZ» html Ò³ÃæÒýÓûòÕß°üº¬µÄ xml Êý¾Ý£¬ÊÇ´Ó IE5 ¿ªÊ¼ÒýÈëµÄÒ»Ïî¼¼Êõ¡£¿ÉÒÔͨ¹ý xml ±êÇ©ºÜÇáËɽ«Êý¾Ýµº²åÈëµ½ html ÎĵµÖС£ÄÇôÔõô·ÃÎÊ xml Êý¾ÝµºµÄÊý¾ÝÄØ£¬ºÜ¼òµ¥£¬Í¨¹ý xml µÄ id ¡£ÔÚÒ³ ......
ÎÊÌâÃèÊö£º
jbossÓ¦Ó÷þÎñÆ÷£¬Ê¹ÓÃspring
ÎÞ·¨Æô¶¯·þÎñ£¬´íÎóÈÕÖ¾£º
[org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@155d3a3] does not
support XML Schema. Are you running on Java 1.4 or below with Apache
Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD ......
ÒýÓÃÃüÃû¿Õ¼ä£ºusing System.Xml
1.¼ì²éËùÒª²Ù×÷µÄxmlÎļþÊÇ·ñ´æÔÚ£º
System.IO.File.Exists(Îļþ·¾¶¼°Ãû³Æ);
2.µÃµ½xmlÎļþ£º
£¨1£©ÔÚasp.netÖпÉÒÔÕâÑùµÃµ½:
XmlDocument xmlDoc = new XmlDocument();
//µ¼ÈëxmlÎĵµ
xmlDoc.Load( Server.MapPath("xmlTesting.xml"));
//µ¼Èë×Ö·û´®
/ ......
·´ÉäÊÇ Java ÓïÑÔ±»ÊÓΪ¶¯Ì¬»ò×¼¶¯Ì¬ÓïÑÔµÄÒ»¸ö¹Ø¼üÐÔÖÊ£¬½áºÏ·´ÉäºÍ XML »á°ïÖúÎÒÃǸü¿ì¡¢¸ü·½±ãµØʵÏÖһЩ¶¯Ì¬´úÂ룬´Ó¶ø½â¾ö±à³ÌÖпÉÄÜÓöµ½µÄ²»È·¶¨ÎÊÌâ¡£±¾ÎĽ«½áºÏ·´ÉäÓë XML ¶Ô Java ±à³ÌµÄ¶¯Ì¬ÐÔ½øÐÐÉîÈëdz³öµÄÌÖÂÛ¡£ÔÚÀí½â±¾ÎĵÄ˼ÏëÖ®ºó£¬Äú¿ÉÒÔ½«ÆäÓ¦Óõ½³ÌÐòÖÐÒÔ´´½¨Áé»îµÄ´úÂë¡£
ÒýÑÔ
ÔÚÏÖʵÉú»îÖУ¬¾³£»á·¢ ......