ÓÃphp¶ÁÈ¡xmlÊý¾Ý
½ñÌ칤×÷ÉÏÅöµ½Ò»¸öÎÊÌâ ÓÉÓÚÎÒÃǵÄÏîÄ¿Êý¾ÝÌ«ÉÙ ËùÒÔÐèÒª´Óweb searchÄDZ߽èµ÷Êý¾Ý£¬ËûÃÇÖ»¸øÎÒÃÇÌṩÁËÒ»¸öxmlµÄ½Ó¿Ú¡£Òò´Ë£¬ÎÒÃÇÐèÒª°ÑxmlµÄÊý¾Ýת»¯³Éhtml³ÊÏÖ¸ø´ó¼Ò¡£ÓÉÓÚÏîÄ¿ÊÇ»ùÓÚphpµÄ£¬ËùÒÔ¾ÍÞðÆúÁËÓÃjsÀ´¶ÁÈ¡xmlÑ¡ÔñÁ˼ÌÐøʹÓÃphp¡£²»¹ý£¬ÎÒÒÔÇ°´ÓÀ´Ã»ÓÐ×ö¹ý´ËÀàµÄ³¢ÊÔ ËùÒÔÕÒÁ˺ܶàÍøÉÏ×ÊÁÏͬʱ²ÎÕÕÁËphpµÄ¹¤×÷Êֲᣬ·¢ÏÖÔÚphp4µÄ»·¾³Ï ÓÃparserº¯ÊýÊÇÒ»¸ö±È½ÏºÃµÄÑ¡Ôñ£¨µ±È»Ò²¿ÉÒÔÓÃdom µ«ÊÇÐèÒª¶Ô·þÎñÆ÷ÖØнøÐÐÅäÖà php5¶ÔdomÖ§³ÖµÃ±È½ÏºÃ£©¡£
ËäÈ»ÒÔǰûÓнӴ¥¹ý´ËÀàÎÊÌ⣬µ«ÊÇ»¹ÊǺܿì¾Í½â¾öÁË£¬²»¹ýÔÚ½â¾öºÍÃþË÷µÄ¹ý³ÌÖз¢ÏÖÍøÉϹØÓÚ´ËÀàµÄ×ÊÁÏËäÈ»²»ÉÙ£¬µ«ÊDzβÆ룬ºÜ¶àÃèÊö²»ÊǺÜÏêϸ£¬»¹ÊDzÙ×÷ÊÖ²á±È½Ï¹ÜÓá£
ºÃÁË£¬ÑÔ¹éÕý´«£º
parserÊÇphpÄÚÖõÄÒ»¸öÓÃÀ´´¦ÀíxmlµÄ½âÎöÆ÷£¬ËüµÄ¹¤×÷ÓÉÈý¸öʼþ×é³É£ºÆðʼ±êÇ©¡¢ ¶ÁÈ¡Êý¾Ý¡¢½áÊø±êÇ©¡£
Ò²¾ÍÊÇ˵ÔÚ¶Ôxml½øÐд¦ÀíµÄʱºòÿµ±Óöµ½Æðʼ±êÇ©¡¢Êý¾ÝºÍ½áÊø±êÇ©µÄʱºòº¯Êý»á×öÏàÓ¦µÄ¶¯×÷À´Íê³É¶ÔxmlÊý¾ÝµÄת»»¡£
phpÖжÔxml¶ÁÈ¡µÄÏà¹Øº¯ÊýµÄ½éÉÜ£º
ÒýÓÃ:
--------------------------------------------------------------------------------
¶ÔÏó XML½âÎöº¯Êý ÃèÊö
ÔªËØ xml_set_element_handler() ÔªËصĿªÊ¼ºÍ½áÊø
×Ö·ûÊý¾Ý xml_set_character_data_handler() ×Ö·ûÊý¾ÝµÄ¿ªÊ¼
ÍⲿʵÌå xml_set_external_entity_ref_handler() ÍⲿʵÌå³öÏÖ
δ½âÎöÍⲿʵÌå xml_set_unparsed_entity_decl_handler() δ½âÎöµÄÍⲿʵÌå³öÏÖ
´¦ÀíÖ¸Áî xml_set_processing_instruction_handler() ´¦ÀíÖ¸ÁîµÄ³öÏÖ
¼Ç·¨ÉùÃ÷ xml_set_notation_decl_handler() ¼Ç·¨ÉùÃ÷µÄ³öÏÖ
ĬÈÏ xml_set_default_handler() ÆäËüûÓÐÖ¸¶¨´¦Àíº¯ÊýµÄʼþ
--------------------------------------------------------------------------------
ÏÂÃæ¾Í¸ø´ó¼Ò¾ÙÒ»¸öССµÄÀý×ÓÓÃparserº¯ÊýÀ´¶ÁÈ¡xmlÊý¾Ý£º
<?php
$parser = xml_parser_create(); //´´½¨Ò»¸öparser±à¼Æ÷
xml_set_element_handler($parser, "startElement", "endElement");//ÉèÁ¢±êÇ©´¥·¢Ê±µÄÏàÓ¦º¯Êý ÕâÀï·Ö±ðΪstartElementºÍendElenment
xml_set_character_data_handler($parser, "characterData");//ÉèÁ¢Êý¾Ý¶ÁȡʱµÄÏàÓ¦º¯Êý
$xml_file="1.xml";//Ö¸¶¨ËùÒª¶ÁÈ¡µÄxmlÎļþ,¿ÉÒÔÊÇurl
$filehandler = fopen($xml_file, "r");//´ò¿ªÎļþ
while ($data = fread($filehandler, 4096))
{
xml_parse($pars
Ïà¹ØÎĵµ£º
Ò»°ãxmlÖÐÈç¹ûº¬ÓÐ&µÈ×Ö·û£¬¿ÉÒÔͨ¹ýCDATAÀ´¹ýÂË£¬µ«ÊǺ¬ÓÐһЩ²»ÈÏʶµÄÌØÊâ×Ö·ûʱºò¾Í»á²»Æð×÷Óã¬ÏÂÃæÊÇ´Ó±ðÈËÄǶùÄÃÀ´µÄÒ»¸ö¹ýÂË·½
·¨£¬¹ýÂËxmlÖеķǷ¨×Ö·û:
//XML±ê×¼¹æ¶¨µÄÎÞЧ×Ö½ÚΪ£º
/*
0×00 – 0×08
0×0b – 0×0c
0×0e – 0×1f
* ......
±¾ÎÄÈí¼þµÄÏÂÔصØÖ·¾Í²»Áгö£¬Ö÷ÒªÊǼǼ°²×°Ê±µÄ²½Öè¼°Ïà¹ØÎÊÌâµÄ´¦Àí·½·¨£»»ùÓÚ°²×°·½·¨Ä¿Ç°ÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÀûÓÃRPM°ü°²×°£¬Ò»ÖÖÔ´Âë±àÒë°²×°£»ÒÔÏÂÖ÷
ÒªÊÇÒÔÔ´Âë±àÒë°²×°£»ÒòΪԴÂë°²×°Èí¼þµÄÏ໥ÒÀÀµÐÔС£¬°²×°·½Ê½Óø÷ÖÖunix/linuxϵͳ£¬Î¬»¤·½±ã¡£Èç¹ûÏëÈ¥³ýÏà¹Ø·þÎñʱ£¬Ö±½Órm
–rfĿ¼ ¼´¿É£»½¨Òé²ÉÓÃÔ´Âë· ......
¡¡¡¡ÔÚƽʱ¹¤×÷ÖУ¬ÄÑÃâ»áÓöµ½°Ñ XML ×÷ΪÊý¾Ý´æ´¢¸ñʽ¡£Ãæ¶ÔÄ¿Ç°ÖÖÀà·±¶àµÄ½â¾ö·½°¸£¬Äĸö×îÊʺÏÎÒÃÇÄØ£¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ¶ÔÕâËÄÖÖÖ÷Á÷·½°¸×öÒ»¸ö²»ÍêÈ«ÆÀ²â£¬½ö½öÕë¶Ô±éÀú XML Õâ¿éÀ´²âÊÔ£¬ÒòΪ±éÀú XML Êǹ¤×÷ÖÐʹÓÃ×î¶àµÄ£¨ÖÁÉÙÎÒÈÏΪ£©¡£
¡¡¡¡Ô¤ ±¸
¡¡¡¡²âÊÔ»·¾³£º
¡¡¡¡AMD ¶¾Áú1.4G OC 1.5G¡¢256M DDR333¡¢Wind ......
Ê×ÏȽ«dom4j-1.6.1.jar,jaxen-1.1.1.jarÁ½¸öjar°üµ¼Èëµ½ÏîÄ¿ÖÐ
reader_config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<db-info>
<driver-name>oracle.jdbc.driver.OracleDriver</driver-name>
<url>jdbc:oracle:thin:@192.168.1.100:1521:orcl</url>
......
1.Ñ¡Ôñ²Ù×÷µÄÊý¾Ý¿â
Á¬½Óµ½·þÎñÆ÷Ö®ºó£¬Ê×ÏÈÐèҪѡÔñÒª½øÐвÙ×÷µÄÊý¾Ý¿â¡£Ê¹ÓÃPHPµÄMSSQLÀ©Õ¹¿âÖеÄmssql_select_db()º¯Êý¼´¿ÉʵÏÖÁ¬½Ó·þÎñÆ÷ÉϵÄÊý¾Ý¿â¡£¸Ãº¯Êý¸ñʽÈçÏ£º
bool mssql_select_db(string database_name[,resource link_identifier)
¸Ãº¯Êý¸÷²ÎÊýÒâÒ壺
a. ²ÎÊý database_nameΪָ¶¨µÄ·þÎñÆ÷ÉÏ¿ÉÓõÄÊý¾Ý ......