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

ʹÓÃLibxml2²Ù×÷XMLÎĵµ

Ò»¡¢Libxml2½éÉÜ£º
Libxml2 ÊÇÒ»¸öxmlµÄcÓïÑÔ°æµÄ½âÎöÆ÷£¬±¾À´ÊÇΪGnomeÏîÄ¿¿ª·¢µÄ¹¤¾ß£¬ÊÇÒ»¸ö»ùÓÚMIT LicenseµÄÃâ·Ñ¿ªÔ´Èí¼þ¡£Ëü³ýÁËÖ§³ÖcÓïÑÔ°æÒÔÍ⣬»¹Ö§³Öc++¡¢PHP¡¢Pascal¡¢Ruby¡¢TclµÈÓïÑԵİ󶨣¬ÄÜÔÚWindows¡¢Linux¡¢Solaris¡¢MacOsXµÈƽ̨ÉÏÔËÐС£¹¦ÄÜ»¹ÊÇÏ൱ǿ´óµÄ£¬ÏàÐÅÂú×ãÒ»°ãÓû§ÐèÇóûÓÐÈκÎÎÊÌâ¡£
¶þ¡¢ Libxml2°²×°£º
Ò»°ãÈç¹ûÔÚ°²×°ÏµÍ³µÄʱºòÑ¡ÖÐÁËËùÓпª·¢¿âºÍ¿ª·¢¹¤¾ßµÄ»°(Fedora CoreϵÁÐÏÂ)£¬Ó¦¸Ã²»Óð²×°£¬ÏÂÃæ½éÉÜÒ»ÏÂÊÖ¶¯°²×°£º
1) ´ÓxmlsoftÕ¾µã»òftp(ftp.xmlsoft.org)Õ¾µãÏÂÔØlibxmlѹËõ°ü(libxml2-xxxx.tar.gz)
2) ¶ÔѹËõ°ü½øÐнâѹËõ
tar xvzf libxml2-xxxx.tar.gz
3) ½øÈë½âѹËõºóµÄÎļþ¼ÐÖÐÔËÐÐ
./configure
make
make install
°²×°Íê³Éºó¾Í¿ÉÒÔʹÓüòµ¥µÄ´úÂë½âÎöXMLÎļþ£¬°üÀ¨±¾µØºÍÔ¶³ÌµÄÎļþ£¬µ«ÊÇÔÚ±àÂëÉÏÓÐһЩÎÊÌâ¡£LibxmlĬÈÏÖ»Ö§³ÖUTF£­8µÄ±àÂ룬ÎÞÂÛÊäÈëÊä³ö¶¼ÊÇUTF-8£¬ËùÒÔÈç¹ûÄã½âÎöÍêÒ»¸öXMLµÃµ½µÄ½á¹û¶¼ÊÇUTF£­8µÄ£¬Èç¹ûÐèÒªÊä³öGB2312»òÕßÆäËü±àÂ룬ÐèÒªICONVÀ´×öתÂë(Éú³ÉUTF£­8±àÂëµÄÎļþÒ²¿ÉÒÔÓÃËü×ö),Èç¹ûϵͳÖÐûÓа²×°iconvµÄ»°£¬ÐèÒª°²×°libiconv¡£
1) ÏÂÔØlibiconvѹËõ°ü(ÀýÈçlibiconv-1.11.tar.gz)
2) ¶ÔѹËõ°ü½øÐнâѹËõ
tar xvzf libiconv-1.11.tar.gz
3) ½øÈë½âѹËõºóµÄÎļþ¼ÐÖÐÔËÐÐ
./configure
make
make install

Èý¡¢¹ØÓÚXML£º
ÔÚ¿ªÊ¼Ñо¿ Libxml2 ¿â֮ǰ£¬ÏÈÁ˽âÒ»ÏÂXMLµÄÏà¹Ø»ù´¡¡£XML ÊÇÒ»ÖÖ»ùÓÚÎı¾µÄ¸ñʽ£¬Ëü¿ÉÓÃÀ´´´½¨Äܹ»Í¨¹ý¸÷ÖÖÓïÑÔºÍƽ̨·ÃÎʵĽṹ»¯Êý¾Ý¡£Ëü°üÀ¨Ò»ÏµÁÐÀàËÆ HTML µÄ±ê¼Ç£¬²¢ÒÔÊ÷ÐͽṹÀ´¶ÔÕâЩ±ê¼Ç½øÐÐÅÅÁС£
ÀýÈ磬¿É²Î¼ûÇåµ¥ 1 ÖнéÉܵļòµ¥Îĵµ¡£ÎªÁ˸üÇå³þµØÏÔʾ XML µÄÒ»°ã¸ÅÄÏÂÃæÊÇÒ»¸ö¼ò»¯µÄXMLÎļþ¡£
Çåµ¥ 1. Ò»¸ö¼òµ¥µÄ XML Îļþ


root
delete
10

Çåµ¥ 1 ÖеĵÚÒ»ÐÐÊÇ XML ÉùÃ÷£¬Ëü¸æË߸ºÔð´¦Àí XML µÄÓ¦ÓóÌÐò£¬¼´½âÎöÆ÷£¬½«Òª´¦ÀíµÄ XML µÄ°æ±¾¡£´ó²¿·ÖµÄÎļþʹÓð汾 1.0 ±àд£¬µ«Ò²ÓÐÉÙÁ¿µÄ°æ±¾ 1.1 µÄÎļþ¡£Ëü»¹¶¨ÒåÁËËùʹÓõıàÂë¡£´ó²¿·ÖÎļþʹÓà UTF-8£¬µ«ÊÇ£¬XML Éè¼ÆÓÃÀ´¼¯³É¸÷ÖÖÓïÑÔÖеÄÊý¾Ý£¬°üÀ¨ÄÇЩ²»Ê¹ÓÃÓ¢Óï×Öĸ


Ïà¹ØÎĵµ£º

XPath,XMLÎĵµ,SelectNodes()ͨÅä·û˵Ã÷


ÀûÓÃXPath¶ÁÈ¡XmlÎļþ
Ö®ËùÒÔÒªÒýÈëXPathµÄ¸ÅÄĿµÄ¾ÍÊÇΪÁËÔÚÆ¥ÅäXMLÎĵµ½á¹¹Ê÷ʱÄܹ»×¼È·µØÕÒµ½Ä³Ò»¸ö½ÚµãÔªËØ¡£¿ÉÒÔ°ÑXPath±È×÷Îļþ¹ÜÀí·¾¶£ºÍ¨¹ýÎļþ¹ÜÀí·¾¶£¬¿ÉÒÔ°´ÕÕÒ»¶¨µÄ¹æÔò²éÕÒµ½ËùÐèÒªµÄÎļþ£»Í¬Ñù£¬ÒÀ¾ÝXPathËùÖƶ¨µÄ¹æÔò£¬Ò²¿ÉÒԺܷ½±ãµØÕÒµ½XML½á¹¹ÎĵµÊ÷ÖеÄÈκÎÒ»¸ö½Úµã.
¡¡¡¡²»¹ý£¬ÓÉÓÚXPath¿ÉÓ¦Ó ......

XML Ôö¡¢É¾¡¢¸Ä¡¢Çóƽ¾ùÊý

string file = "c:\\work.xml";
        private void btnCearte_Click(object sender, EventArgs e)
        {
            XmlDocument doc = new XmlDocument();
    ......

XML DTD XSD XSL XDR¶¼ÓÐʲôÇø±ð?

XML=¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ(eXtensible Markup Language).
¿ÉÀ©Õ¹±ê¼ÇÓïÑÔXMLÊÇÒ»ÖÖ¼òµ¥µÄÊý¾Ý´æ´¢ÓïÑÔ£¬Ê¹ÓÃһϵÁмòµ¥µÄ±ê¼ÇÃèÊöÊý¾Ý£¬¶øÕâЩ±ê¼Ç¿ÉÒÔÓ÷½±ãµÄ·½Ê½½¨Á¢£¬ËäÈ»XMLÕ¼ÓõĿռä±È¶þ½øÖÆÊý¾ÝÒªÕ¼Óøü¶àµÄ¿Õ¼ä£¬µ«XML¼«Æä¼òµ¥Ò×ÓÚÕÆÎÕºÍʹÓá£
XMLµÄ¼òµ¥Ê¹ÆäÒ×ÓÚÔÚÈκÎÓ¦ÓóÌÐòÖжÁдÊý¾Ý£¬ÕâʹXMLºÜ¿ì³ÉΪÊý¾Ý½»»»µÄ ......

js ¶ÁÈ¡xml¼æÈݸ÷ÖÖä¯ÀÀÆ÷

var xmlDom; //XML DOM object
var xmlFile="ff.xml"; //xml file name
loadXML = function(fileRoute){
xmlDoc=null;
if (window.ActiveXObject){
xmlDoc = new ActiveXObject('Msxml2.DOMDocument');
xmlDoc.async=false;
xmlDoc.load(fileRoute);
}else if (document.implementation &a ......

xmlÓëdataset£¨datatable£©»¥×ª

ÒýÓÃÀà¿â£º
 using System;
 using System.Data;
 using System.IO;
 using System.Xml;
using System.Text;
// ÏàÓ¦C#´úÂ룺
private string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ