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

phpÏÂÄÄÖÖ·½·¨ºÏÊʽâÎöxml£¬×ª»»³Éjson¸ñʽ

½âÎöxmlÎĵµµÄÀà¿âÓкܶàÖÖ£¬±È½Ï³£ÓõľÍÊÇSimpleXML£¬DOM Document£¬XMLReader£¬»ùÓÚSAXµÄxml_parseº¯Êý¡£
¸ù¾ÝxmlÎĵµ½á¹¹£¬ÒÔ¼°ÐèÇóµÄ²»Í¬£¬ÒªÑ¡ÔñºÃ¶ÔÓ¦µÄÀà¿â¡£
½âÎöСµÄÎĵµµÄ»°£¬Ê¹ÓÃSimpleXML±È½ÏºÏÊÊ£¬¼òµ¥µÄ¼¸¸öº¯Êý¾Í¿ÉÒԸ㶨¡£
Èç¹ûÎĵµ·Ç³£¾Þ´ó£¬×îºÃÊÇXMLReader´ò¿ª£¬Öмäת»»³ÉDOMÀ´½âÎö£¬¸Ð¾õDOMÓëXPath½áºÏµÄ±È½ÏºÃ¡£
ÒÔÉÏÊǽâÎöÒÑÖªÎĵµ½á¹¹µÄXML£¬±ÈÈçÖªµÀʹÓÃÁËʲôÃüÃû¿Õ¼ä£¬ÓÐÄÄЩÖ÷ÒªµÄ½ÚµãµÈµÈÐÅÏ¢µÄXMLÎĵµ¡£
Èç¹ûÊÇÒª½âÎöÈÎÒâµÄXMLÎĵµ£¬»¹ÊÇSAXµÄxml_parse±È½ÏºÏÊÊ£¬×Ô¼º¶¨ÒåÈý¸öhandlerº¯Êý¡£
±ÈÈç±ÊÕß¾ÍÊÇÓÃxml_parseÀ´½âÎöÈÎÒâµÄxmlÎĵµ£¬Éú³Éjson¸ñʽµÄ×Ö·û´®¡£
ÏÂÃæ°ÑʹÓÃxml_parseÀ´½âÎöxmlÎĵµµÄËùÐèÒªµÄÈý¸öhandler½²½âÒ»±é¡£
Ê×ÏÈÊÇÈý¸ö±äÁ¿
$depthÊÇÖ¸xmlÎĵµ½á¹¹µÄ²ãÊý£¬µÚÒ»²ãµÄÖµÊÇ0¡£
$json_arrayÊÇÒ»¸ö¶àλÊý×飬ÿһ¸öÔªËصijÉÔ±ÊÇÒ»¸öjsonÊý×飬ֱ½Ó¿ÉÒÔÓÃjson_encodeº¯Êý¡£
Õâ¸öÊý×éµÄµÚһάµÄindexÊÇÉÏÃæµÄ$depth£¬½âÎöÍêÿһ²ãµÄxml½á¹¹ºó£¬¶¼½«Æä½á¹û"Õ³Ìù"µ½Æ丸½ÚµãµÄ×îºóÒ»¸ö×Ö½Úµãºó±ß¡£
½âÎöÍê³Éºó$json_array[0]¾ÍÊÇËùÓеÄxmlÎĵµÄÚÈݶ¼ÔÚÀïÃæÀ²¡£
$tag_name_stackÒ²ÊÇÒ»¸öÊý×飬ºó½øÏȳöµÄÊý×飬ÕýÔÚ´¦ÀíµÄ±êÇ©Ãû¾Í´æÔÚÕâÀïÃ棬´¦ÀíÍêÒ»¸ö±êÇ©ºó£¬¾Í½«ÆäÇë³öÊý×é¡£
private $depth = -1;
private $json_array = array();
private $tag_name_stack = array();
private function start_handler($parser, $name, $attrs) {
$arrts_array = array();
foreach ($attrs as $attr_name => $attr_value) {
$attr_name = str_replace(":", "$", $attr_name);
$arrts_array[$attr_name]=$attr_value;
}
$tag_name = str_replace(":", "$", $name);
$this->tag_name_stack[] = $tag_name;
$this->depth++;
//if (count($arrts_array) != 0) {
$this->json_array[$this->depth][$tag_name] = $arrts_array;<br>
Ê×ÏÈÊǰѸñêÇ©µÄÊôÐÔ¶¼×°ÈëÒ»¸öÊý×é
foreach ($attrs as $attr_name => $attr_value) {
      $attr_name = str_replace(":", "$", $attr_nam


Ïà¹ØÎĵµ£º

c# ¶ÁдXMLÎļþ

¡¡¡¡¡¡ÓÃc#¸øPDA×öÁËÒ»¸öPC¶ËµÄͨѶ³ÌÐò£¬ÐèÒª±£´æÁ½¸ö²ÎÊý¡£ÓÃDelphiʱ£¬ÊDZ£´æÔÚiniÎļþÖУ¬c#¶ÁдXML±È½Ï·½±ã£¬¾ÍÓÃxmlÎļþÀ´±£´æÁË¡£
¡¡¡¡¡¡
¡¡
class CXmlClass
{
private string XmlFilePath;
/// <summary>
/// ÏÂÔص½PDAµÄTXTÎļþ·¾¶¡¡
/// </summary>
......

XML³£ÓòÙ×÷

 XMLÔÚÎÒÃǵijÌÐòÖÐÓõ½µÄÔ½À´Ô½¶à£¬ÒòΪËü´æ´¢¡¢¶ÁÈ¡¡¢Ð޸Ķ¼±È½Ï·½±ã¡£
ÏÂÃæÎÒÀ´·ÖÏíÒ»ÏÂXMLµÄ³£ÓòÙ×÷(Ôöɾ¸Ä²é)£¬ÏÂÃæÊdzÌÐòÔËÐÐЧ¹û£º
Ôö(Ôö¼Ó½Úµã°üÀ¨´´½¨XML):
/// <summary>
/// ´´½¨XMLÎĵµ
/// </summary>
/// <param name="path"></param>
......

ʹÓÃJOX ½øÐÐJavaBeanºÍXMLµÄת»»

½ñÌìÊÔÁ˸öXMLºÍJavaBeanת»»µÄÈí¼þJOX£¬Ö®Ç°Ò»Ö±ÓÐÕâÑùµÄÐèÇ󣬵«±È½ÏÀ´±È½ÏÈ¥»¹ÊÇÕâ¸ö±È½Ï¼òµ¥ÊµÓá£ÎÒÏë³ý·ÇÎÒÓÐWSµÄÐèÇ󣬷ñÔòÏóJIBXºÍAPACHE µÄWS¹¤¾ß¶ÔÎÒÀ´Ëµ¶¼ÊÇÖØÁ¿¼¶µÄ¡£
ÏÈ¿´¿´Êä³ö½á¹û£º
<?xml version="1.0" encoding="ISO-8859-1"?>
<ApproxItem java-class="com.greatwall.csi.np.model.Approx ......

ÕÐƸjsp\phpÍøÕ¾¿ª·¢³ÌÐòÔ±

ÉϺ£ÔóÎäÍøÂçÓÐÏÞ¹«Ë¾
ÕÐƸ£ºÕÐƸjsp\phpÍøÕ¾¿ª·¢³ÌÐòÔ±
ÒªÇóÓÐÈýÄêÒÔÉÏ¿ª·¢¾­Ñé
¶ÔTomcat+Apache¼¯Èº¼¼ÊõÓÐÊìϤµÄ¾­Ñé.¶ÔËÑË÷ÒýÇæ¼¼Êõ(Lucene)±È½ÏÁ˽⡣
-ÊìÁ·Ê¹ÓÃUML½¨Ä£¹¤¾ß¡¢°æ±¾¿ØÖƹ¤¾ß; ÊìÁ·Ê¹ÓÃEclipseµÈIDE¿ª·¢¹¤¾ß;
-¾«Í¨JAVA,php,ÉîÈëÀí½âOOP˼Ïë,ÊìϤÉè¼Æģʽ¡£
-ÊìÁ·ÔËÓÃJ2EE¼¼Êõ¡¢WEB·þÎñÆ÷ºÍ¹ØϵР......

ÈçºÎ½«php»ñµÃµÄʱ¼äת»»Îª±±¾©Ê±¼ä

´Óphp5.10¿ªÊ¼£¬phpÖмÓÈëÁËʱÇøµÄÉèÖã¬ÔÚphpÖÐÏÔʾµÄʱ¼ä¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä£¬Õâ¾ÍÔì³ÉÁËÎÒÃÇÖйúµÄÓû§»á²î°Ë¸öСʱµÄÎÊÌ⣡
Ïà¹ØÉèÖÃÊÇÐÞ¸Äphp.iniÖÐµÄ date.timezone ²ÎÊý£º
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
ĬÈÏÊǹرյģ¬Ö»Ðè°Ñ×¢ÊÍÈ¥µô£¬¸ÄΪ¼´¿É
[Dat ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ