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

PHP+DOM´´½¨XMLÎļþ

´´½¨ÎĵµÀàÐÍÉùÃ÷
Ò»°ã¶øÑÔ£¬XMLÉùÃ÷·ÅÔÚÎĵµ¶¥²¿¡£ÔÚPHPÖÐÉùÃ÷Ê®·Ö¼òµ¥£ºÖ»ÐèʵÀý»¯Ò»¸öDOMÎĵµÀàµÄ¶ÔÏ󲢸³ÓèËüÒ»¸ö°æ±¾ºÅ¡£²é¿´³ÌÐòÇåµ¥A£º
³ÌÐòÇåµ¥ A
<?php
// create doctype
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// display document in browser as plain text
// for readability purposes
header("Content-Type: text/plain");
// save_and_display tree
echo $dom->saveXML();
?>
Çë×¢ÒâDOMÎĵµ¶ÔÏóµÄsaveXML()·½·¨¡£ÉÔºóÎÒÔÙÏêϸ½éÉÜÕâÒ»·½·¨£¬ÏÖÔÚÄãÖ»ÐèÒª¼òµ¥ÈÏʶµ½ËüÓÃÓÚÊä³öXMLÎĵµµÄµ±Ç°¿ìÕÕµ½Ò»¸öÎļþ»òä¯ÀÀÆ÷¡£ÔÚ±¾Àý£¬ÎªÔöÇ¿¿É¶ÁÐÔ£¬ÎÒÒѾ­½«ASCIIÂëÎı¾Ö±½ÓÊä³öÖÁä¯ÀÀÆ÷¡£ÔÚʵ¼ÊÓ¦ÓÃÖУ¬¿É½«ÒÔtext/XMLÍ·Îļþ·¢Ë͵½ä¯ÀÀÆ÷¡£
ÈçÔÚä¯ÀÀÆ÷Öв鿴Êä³ö£¬Äã¿É¿´µ½ÈçÏ´úÂ룺
<?xml version="1.0"?>
Ìí¼ÓÔªËغÍÎı¾½Úµã
XMLÕæÕýÇ¿´óµÄ¹¦ÄÜÊÇÀ´×ÔÆäÔªËØÓë·â×°µÄÄÚÈÝ¡£ÐÒÔ˵ÄÊÇ£¬Ò»µ©Äã³õʼ»¯DOMÎĵµ£¬ºÜ¶à²Ù×÷±äµÃºÜ¼òµ¥¡£´Ë¹ý³Ì°üº¬ÈçÏÂÁ½²½Ö裺
¶ÔÏëÌí¼ÓµÄÿһԪËØ»òÎı¾½Úµã£¬Í¨¹ýÔªËØÃû»òÎı¾ÄÚÈݵ÷ÓÃDOMÎĵµ¶ÔÏóµÄcreateElement()»òcreateTextNode()·½·¨¡£Õ⽫´´½¨¶ÔÓ¦ÓÚÔªËØ»òÎı¾½ÚµãµÄжÔÏó¡£
ͨ¹ýµ÷ÓýڵãµÄappendChild()·½·¨£¬²¢°ÑÆä´«µÝ¸øÉÏÒ»²½Öд´½¨µÄ¶ÔÏ󣬲¢ÔÚXMLÎĵµÊ÷Öн«ÔªËØ»òÎı¾½ÚµãÌí¼Óµ½¸¸½Úµã¡£
ÒÔÏ·¶Àý½«Çå³þµØÑÝʾÕâ2²½Ö裬Çë²é¿´³ÌÐòÇåµ¥B¡£
³ÌÐòÇåµ¥ B
<?php
// create doctype
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// for readability purposes
header("Content-Type: text/plain");
// create root element
$root = $dom->createElement("toppings");
$dom->appendChild($root);
// create child element
$item = $dom->createElement("item");
$root->appendChild($item);
// create text node
$text = $dom->createTextNode("pepperoni");
$item->appendChild($text);
// save_and_display tree
echo $dom->saveXML();
?>
ÕâÀÎÒÊ×ÏÈ´´½¨Ò»¸öÃû×ÖΪ<toppings>µÄ¸ùÔªËØ£¬²¢Ê¹Ëü¹éÓÚXMLÍ·ÎļþÖС£È»ºó£¬ÎÒ½¨Á¢ÃûΪ<item>µÄÔªËز¢Ê¹Ëü¹éÓÚ¸ùÔªËØ¡£×îºó£¬ÎÒÓÖ´´½¨Ò»¸öֵΪ“pepperoni”µÄÎı¾½Úµã²¢Ê¹Ëü¹éÓÚ<item>ÔªËØ¡£×îÖÕ½á¹ûÈçÏ£º
<?xml version="1.0"?>
<toppings>
?<


Ïà¹ØÎĵµ£º

php ³ÌÐòµÄ¹ú¼Ê»¯gettext

²½ÖèÒ»£º´î½¨»·¾³
1£¬Ê×ÏȲ鿴ÄãµÄphpÀ©Õ¹Ä¿Â¼ÏÂÊÇ·ñÓÐphp_gettext.dllÕâ¸ö
Îļþ£¬Èç¹ûûÓУ¬Õâ¾ÍÐèÒªÄã
ÏÂÔØÒ»¸ö»òÊÇ´ÓÆäËûµØ·½¿½±´Ò»¸ö£¬È»ºó·Åµ½phpÀ©Õ¹Ä¿Â¼¡£
2£¬´ò¿ªphp.ini£¬²é
ÕÒ”;extension=php_gettext.dll“ £¬È»ºóÈ¥³ý×¢ÊÍ£¬ÖØÆôapache¡£
²½Öè¶þ:Ô­Àí½²½â
¼ÙÈçÄãµÄû
Óйú¼Ê»¯µÄ³ÌÐòÀïÓÐÕâÑù ......

[ת]Android¶ÁдXML£¨ÖУ©——SAX


 Õª×Ô--http://www.moandroid.com/?p=821
Android¶ÁдXML£¨ÖУ©——SAX
By: º£ÊÐò×Â¥ | In: Android¿ª·¢
22 ¾Å 2009
ÔÚAndroid¶ÁдXML£¨ÉÏ£©——package˵Ã÷ÖУ¬Ïêϸ½éÉÜÁËʹÓà DOM·½·¨¶ÁÈ¡XMLÎĵµ£¬ÓÉÓÚʹÓÃDOM·½·¨ÐèÒª½«Õû¸öXMLÎĵµ¼ÓÔØÄÚ´æÖУ¬¶Ôϵͳ×ÊÔ´Õ¼ÓñȽ϶࣬Õâ¶ÔÄÚ´æ±È½Ï½ôÕŵ ......

D Busѧϰ£¨Æߣ©£ºÀûÓÃXML¶¨ÒåD BusÖ®ClientµÄÀý×Ó


¡¡¡¡¼ÌÐøѧϰD-Bus¡£Ö®Ç°Ñ§Ï°ÁËʹÓõײãµÄAPIÀ´·¢ËÍ£¬¼àÌýÏûÏ¢µÄ·½Ê½¡£ÔÚ
D-
Busѧϰ£¨ËÄ£©£º»ù´¡Ð¡Àý×Ó£¨Í¬²½ºÍÒì²½£©
Ö®ÖУ¬ÎÒÃǸø³öÁËÀûÓÃproxy½øÐз¢ËÍmethod_call£¬²¢µÈ´ýmethod_reply»òÕßerrorµÄclientÇé¿ö¡£ÔÚD-BusÖУ¬¿ÉÒÔ½«D-Bus½Ó¿Ú¶¨ÒåÓÃXML¸ñʽ±íÊö´¦Àí£¬²¢ÀûÓù¤¾ß£¬×Ô¶¯Éú³ÉÍ·Îļþ£¬¸ø³ö¹¤ÕûµÄµ÷Ó÷½Ê½¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ