Óà PHP ¶ÁÈ¡ºÍ±àд XML DOM
Óà PHP ¶ÁÈ¡ºÍ±àд XML DOM
ʹÓà DOM ¿â¡¢SAX ½âÎöÆ÷ºÍÕýÔò±í´ïʽ
ÓÐÐí¶à¼¼Êõ¿ÉÓÃÓÚÓà PHP ¶ÁÈ¡ºÍ±àд XML¡£±¾ÎÄÌṩÁËÈýÖÖ·½·¨¶ÁÈ¡ XML£ºÊ¹Óà DOM ¿â¡¢Ê¹Óà SAX ½âÎöÆ÷ºÍʹÓÃÕýÔò±í´ïʽ¡£»¹½éÉÜÁËʹÓà DOM ºÍ PHP Îı¾Ä£°å±àд XML¡£
Óà PHP ¶ÁÈ¡ºÍ±àд¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ£¨XML£©¿´ÆðÀ´¿ÉÄÜÓеã¿Ö²À¡£Êµ¼ÊÉÏ£¬XML ºÍËüµÄËùÓÐÏà¹Ø¼¼Êõ¿ÉÄÜÊÇ¿Ö²ÀµÄ£¬µ«ÊÇÓà PHP
¶ÁÈ¡ºÍ±àд XML ²»Ò»¶¨ÊÇÏî¿Ö²ÀµÄÈÎÎñ¡£Ê×ÏÈ£¬ÐèҪѧϰһµã¹ØÓÚ XML µÄ֪ʶ —— ËüÊÇʲô£¬ÓÃËü×öʲô¡£È»ºó£¬ÐèҪѧϰÈçºÎÓà PHP
¶ÁÈ¡ºÍ±àд XML£¬¶øÓÐÐí¶àÖÖ·½Ê½¿ÉÒÔ×öÕâ¼þÊ¡£
±¾ÎÄÌṩÁË XML µÄ¼ò¶ÌÈëÃÅ£¬È»ºó½âÊÍÈçºÎÓà PHP ¶ÁÈ¡ºÍ±àд XML¡£
ʲôÊÇ XML£¿
XML ÊÇÒ»ÖÖÊý¾Ý´æ´¢¸ñʽ¡£ËüûÓж¨Òå±£´æʲôÊý¾Ý£¬Ò²Ã»Óж¨ÒåÊý¾ÝµÄ¸ñʽ¡£XML Ö»ÊǶ¨ÒåÁ˱ê¼ÇºÍÕâЩ±ê¼ÇµÄÊôÐÔ¡£¸ñʽÁ¼ºÃµÄ XML ±ê¼Ç¿´ÆðÀ´ÏñÕâÑù£º
<name>Jack Herrington</name>
Õâ¸ö <name>
±ê¼Ç°üº¬Ò»Ð©Îı¾£ºJack Herrington¡£
²»°üº¬Îı¾µÄ XML ±ê¼Ç¿´ÆðÀ´ÏñÕâÑù£º
<powerUp />
Óà XML ¶Ôij¼þʽøÐбàдµÄ·½Ê½²»Ö¹Ò»ÖÖ¡£ÀýÈ磬Õâ¸ö±ê¼ÇÐγɵÄÊä³öÓëÇ°Ò»¸ö±ê¼ÇÏàͬ£º
<powerUp></powerUp>
Ò²¿ÉÒÔÏò XML ±ê¼ÇÌí¼ÓÊôÐÔ¡£ÀýÈ磬Õâ¸ö <name>
±ê¼Ç°üº¬ first
ºÍ last
ÊôÐÔ£º
<name first="Jack" last="Herrington" />
Ò²¿ÉÒÔÓà XML ¶ÔÌØÊâ×Ö·û½øÐбàÂë¡£ÀýÈ磬& ·ûºÅ¿ÉÒÔÏñÕâÑù±àÂ룺
&
°üº¬±ê¼ÇºÍÊôÐ﵀ XML ÎļþÈç¹ûÏñʾÀýÒ»Ñù¸ñʽ»¯£¬¾ÍÊǸñʽÁ¼ºÃµÄ
£¬ÕâÒâζ×űê¼ÇÊǶԳƵģ¬×Ö·ûµÄ±àÂëÕýÈ·¡£Çåµ¥ 1 ÊÇÒ»·Ý¸ñʽÁ¼ºÃµÄ XML µÄʾÀý¡£
Çåµ¥ 1. XML ͼÊéÁбíʾÀý
<books>
<book>
<author>Jack Herrington</author>
<title>PHP Hacks</title>
<publisher>O'Reilly</publisher>
</book>
<book>
<author>Jack Herrington</author>
<title>Podcasting Hacks</title>
<publisher>O'Reilly</publisher>
</book>
</books>
Çåµ¥ 1 ÖÐµÄ XML °üº¬Ò»¸öͼÊéÁÐ±í¡£¸¸±ê¼Ç <books>
°üº¬Ò»×é <book>
±ê¼Ç£¬Ã¿¸ö <book>
±ê¼ÇÓÖ°üº¬ <author>
¡¢<title>
ºÍ <publisher>
±ê¼Ç¡£
µ± XML ÎĵµµÄ±ê¼Ç½á¹¹ºÍÄÚÈݵõ½ÍⲿÄ
Ïà¹ØÎĵµ£º
ÕâÁ½ÌìÅöµ½Ò»¸öСÎÊÌ⿨ÁËÎÒÀÏ°ëÌì……¾ÍÊÇLINUXÏÂPHP³ÌÐòÓëÆäËû³ÌÐòͨÐÅ¡£
ÎÒÃÇÐèҪʵÏÖÓû§ÔÚWEBÒ³ÃæÉϽøÐвÙ×÷ʱ¿ÉÒÔÆôÓÃÎÒÃÇÔÚ·þÎñÆ÷¶ËµÄºǫ́³ÌÐò£¨ÓÃC¡¢C++±àд£©¡£
֮ǰÔÚwindowsÏ£¬ÒѾʹÓÃÃüÃû¹ÜµÀʵÏÖ£¨Çë¼ûÎÒ֮ǰµÄ²©ÎÄhttp://blog.csdn.net/rcfalcon/archive/2010/02/09/5303142.aspx£©£¬Õâ´Î½«· ......
SGML¹ýÓÚ¸´ÔÓ£¬¹Ø¼üÖ®´¦»¹ÔÚÓÚÖ÷Á÷ä¯ÀÀÆ÷³§É̲»Ö§³ÖSGML£¬webÓ¦ÓúܺÃ
Little version£ºXML
html => xhtml =>xml¿ÉÒÔÀí½â³ÉÊÇÒ»¸ö¹ý¶ÉµÄ¹ý³Ì
SGMLµÄÉè¼ÆÀíÄî¾ÍÊÇ°ÑÎı¾µÄÄÚÈݺÍÑùʽ·Ö¿ª£¬×ÔÈ»xmlÒ²ÊÇÈç´Ë¡£
xmlÒ»°ã°üÀ¨ÒÔÏÂÎļþ£º
DTD-->schema(xsd) ¶¨ÒåÎĵµ½á¹¹µÈ£¨ÄÚÈÝ£©
CSS-->XSLT (Ñùʽ)
xml ---- ......
jaxpÊÇsun¹«Ë¾µÄ½âÎöxmlÎĵµµÄapi,ËûÖ§³ÖÓÃdomºÍsaxÁ½ÖÖ·½·¨½âÎöÒ»¸öxmlÎĵµ.
dom·½·¨ÊǽâÎöÒýÇ潫Õû¸öxmlÎĵµ×°Ôص½ÄÚ´æÖÐ×÷Ϊһ¸ödocument¶ÔÏó,dom·½·¨µÃµ½Ò»¸ö¶ÔÏó¾ÍÖªµÀËùÓеĽڵã
Ôöɾ¸Ä²éºÜ·½±ã,ȱµãÊÇҪװÔØÕû¸öxmlÎĵµ,Èç¹ûxmlÎĵµºÜ´ó,ЧÂʾͱȽϵÍ
sax·½·¨ÊDzÉÓÃʼþ×÷ΪÇý¶¯µÄ,Óöµ½Ò»¸ö±êÇ©ÊÇÒ»¸öʼþ,¶Áµ½±ê ......
ÈýÄêǰתÓïÑÔ×öÁËJ2ee£¬½ñÌìÎÒÓֻص½µÄԵ㡣ÈýÄêÇ°ÎÒÓÃPHPµÄ¿ª·¢ÍøÕ¾µÄ·½Ê½½øÈëÁËÈí¼þÕâ¸öÐÐÒµ£¬Ã»Ïëµ½ÏÖÔÚÎÒÓÖ»ØÀ´ÁË£¬ÕõÔú×ÅÍ´¿àµÄ»ØÀ´ÁË¡£
½«À´µÄÈí¼þ¿ª·¢ºÍ¹ÜÀíÎÒ½«×¨×¢ÓÚ»¥ÁªÍø¼¼ÊõµÄ·¢Õ¹¡£
ÀÎɧ·¢ÍêÁË¡£ÏÖÔÚÈÃÎÒÀ´¼Ç¼һÏÂÎÒ¶ÔSESSIONµÄdz¼û°É¡£
ͨ¹ýini_set('session.use_trans_sid', 0);ÉèÖÃÔËÐл·¾³ÖйØÓÚSESS ......
PHPµÄÁ÷ÐУ¬¾ø²»ÊÇżȻµÄ£¬¸÷ÖÖ¿ªÔ´¸¨ÖúÏîÄ¿Æðµ½Á˲»Ð¡µÄ×÷Óá£
1. ·¢ËÍÓʼþ phpmailer
2. ¹ÜÀíÓû§ Php user class
3. ץȡRSSժҪ Magpie RSS
4. »ñÈ¡·ÃÎÊÕߵĵØÀíÐÅÏ¢ Maxmind
5. »ñÈ¡Ô¶³ÌÄÚÈÝ htmlSQL class
6. Trackback php trackback
7. Ä£°åϵͳ£¬µ±È»¾ÍÊÇSmarty ÁË
8. BBcode StringParser_B ......