xmlÎĵµÀﺬÓÐÌØÊâ×Ö·ûʱµÄ´¦Àí·½·¨(php)
¡¡¡¡±¾ÎÄÊ×·¢´úÂëÌìÏÂ,תÔØÇë×¢Ã÷À´Ô´´úÂëÌìÏ£¬Ð»Ð»¡£
¡¡¡¡½ñÌìÉÏ°àʱÓöµ½Ò»¸öÎÊÌ⣬ÓÎÏ·¹Ù·´Ó¦Ò»¸öÓû§³ä²»ÁËÖµ¡£³ä²»ÁËÖµÒ»°ãΪÓû§½ÇÉ«²»ÕýÈ·£¬ÎÒ×Ðϸ¼ì²é·¢ÏÖ¸ÃÓû§½ÇÉ«ÓеãÒì³££¬ÒòΪ¶Ô·½·µ»Ø½ÇÉ«ÊÇxml£¬ÎÒÌùÉÏÀ´¸ø´ó¼Ò¿´Ò»Ï£º
<Result value="true" message="Success!"> <Item ID="79965" UserName="ming358" NickName="丅¢ÙÕ¾0¼Åį" Grade="18" Repute="25" Sex="false" WinCount="577" TotalCount="654" ConsortiaName="´Îʱ´ú" Rename="false" ConsortiaRename="false" EscapeCount="0" IsFirst="109" /> </Result>
ÔÀ´£¬Õâ¸öxmlÀïÓÐ&·ûºÅ£¬Õâ¸ö&·ûºÅÔÚ.NETÀïÊÇ¿ÉÒÔÕý³£¶ÁÈ¡µÄ£¬µ«ÊÇÔÚphpÀïÊDz»Ðеģ¬phpÀïÈç¹û¼ÓÔصĻ°£¬»á·¢ÉúÒÔÏ´íÎó£º
Warning: DOMDocument::load() [function.DOMDocument-load]: xmlParseCharRef: invalid xmlChar value 1 in file:///E%3A/phpsite/web2.7k7k.com/games/test.xml, line: 4 in E:\phpsite\web2.7k7k.com\read_xml.php on line 5
ÒòΪ¹Ù·½³ÌÐòÊÇ.net£¬ÔÚ·µ»Øxml¹ý³ÌÖУ¬ºöÂÔÁ˶ÔÌØÊâ·ûºÅµÄ¹ýÂË£¬“”¾ÍÊÇÓû§ÊäÈë»ðÐÇÎIJúÉúµÄÒ»¸öÌØÊâ·ûºÅ¡£ÓÚÊǸø¹Ù·½ÁªÏµ£¬ËûÃÇ˵Õâ¸ö½Ó¿Úʱ²»Äܸĵģ¬Ç£³¶µ½¶à¸öÔËÓªÉÌßóßóÍáÍá˵ÁËһͨ£¬×ÜÖ®£¬½Ó¿Úʱ²»Äܸĵģ¬×Ô¼ºÏë°ì·¨°É¡£ÎÒÊÇÄǸöÓôÃÆ°¡£¬Äã´«¹ýÀ´Êý¾Ý¾ÍÊDz»¶ÔµÄ£¬ÈÃÎÒÏë°ì·¨¸Ä°¡£¿ÉúÆøûÓã¬ÎÊÌ⻹µÃ½â¾ö£¬ÓÚÊÇÖ»ÄÜÏëÆäËü°ì·¨ÁË£ºÏÈÓÃfile_get_contents»ñÈ¡Êý¾Ý£¬°Ñ&·ûºÅÌ滻Ϊ×Ô¼ºÄÜʶ±ðµÄ×Ö·û£¬ÀýÈç{xml},È»ºóÓÃsimplexml_load_stringº¯Êýת»¯ÎªÊý×飬×îºóÔÙ°Ñ{xml}Ì滻Ϊ&£¬ok£¬ÎÊÌâ½â¾ö¡£´úÂëÈçÏ£º
$result = file_get_contents("http://www.code163.com/test.php?user=code163"); //»ñÈ¡xml echo $result; $result = str_replace("&","{xml}",$result); $string = <<<XML $result XML; $xml = simplexml_load_string($string); //ÔØÈë //$xml = simplexml_load_file($str); $part =&
Ïà¹ØÎĵµ£º
Õª×Ô--http://www.moandroid.com/?p=821
Android¶ÁдXML£¨ÖУ©——SAX
By: º£ÊÐò×Â¥ | In: Android¿ª·¢
22 ¾Å 2009
ÔÚAndroid¶ÁдXML£¨ÉÏ£©——package˵Ã÷ÖУ¬Ïêϸ½éÉÜÁËʹÓà DOM·½·¨¶ÁÈ¡XMLÎĵµ£¬ÓÉÓÚʹÓÃDOM·½·¨ÐèÒª½«Õû¸öXMLÎĵµ¼ÓÔØÄÚ´æÖУ¬¶Ôϵͳ×ÊÔ´Õ¼ÓñȽ϶࣬Õâ¶ÔÄÚ´æ±È½Ï½ôÕŵ ......
http://stackoverflow.com/questions/1112828/cannot-decode-string-with-wide-characters-appears-on-a-weird-place
http://man.ddvip.com/web/xmlzhzn/xml_cn/xml_encoding.asp.htm
http://bbs.xml.org.cn/dispbbs.asp?boardID=8&ID=7226
http://topic.csdn.net/t/20030909/13/2240153.html
#
http://www.ezloo. ......
XML ºÍ JSON Êǵ±½ñ³£ÓõÄÁ½ÖÖÊý¾ÝÃèÊöÓë´«ÊäµÄ¸ñʽ£¬ÌرðÊÇÉæ¼°µ½ JS ʱʹÓà JSON ÆÄΪƵ·±¡£×ÔÈ»£¬ÔÚ Java µÄÊÀ½çÀïÉÙ²»ÁËÍê³É JavaBean ÓëÕâÁ½ÖÖ¸ñʽÏ໥ת»»µÄ×é¼þ£¬ÄǾÍÊÇ XStream ºÍ JSON-lib¡£ÕâÀïÎÒ¼òµ¥¼ÇÏ XStream µÄÓ÷¨¡£
ÆäʵÏàÀàËƵŤ¾ßÔçÒÑÓÐÖ®¡£Èç¹ûÓùý DWR µÄͬ־£¬Ò»¶¨ÓÐÓ¡Ïñ£¬DWR ½øÐÐÔ¶ ......
<?PHP
//====================================================
// FileName: snap.class.php
//   ......