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

[Perl]ÓÃXML::Simple½âÎöXMLÎļþ

ÔÚPerlÖнâÎöXMLµÄ·½·¨×î³£¼ûµÄ¾ÍÊÇʹÓà XML::DOM
ºÍ XML::SimpleÁË¡£
XML::DOM¹ýÓÚÅӴ󣬶øÇÒ½âÎö½á¹ûÊÇÒ»¸öDOMÊ÷£¬²Ù×÷Ò²²»·½±ã¡£
¶ÔÓÚСÐÍÇÒ²»¸´ÔÓµÄXMLÎļþ£¬XML::DOMÕæÊÇɱ¼¦ÓÃÅ£µ¶¡£
Õâʱ¾ÍÂÖµ½Çá±ãµÄXML::SimpleÉϳ¡ÁË¡£
XML::SimpleÈçÆäÃû£¬ÕæµÄºÜ¼òµ¥¡£¼ÙÉèXMLÄÚÈÝÈçÏ£º
<opt>
<user login="grep" fullname="Gary R Epstein" />
<user login="stty" fullname="Simon T Tyson" >
<session pid="12345"/>
</user>
<text>This is a test.</text>
</opt>
ÄÇôֻÐèÕâÑùд£º
use XML::Simple;
use Data::Dumper;
$xml = XMLin('sample.xml');
print Dumper($xml);
¾Í¿ÉÒÔÇá¶øÒ׾ٵؽ«XML½âÎö³ÉÒ»¸öhash£¬È»ºóÓÃforeachÒÀ´Î´¦Àí¼´¿É¡£
$VAR1 = {
'text' => 'This is a test.',
'user' => [
{
'fullname' => 'Gary R Epstein',
'login' => 'grep'
},
{
'session' => {
'pid' => '12345'
},
'fullname' => 'Simon T Tyson',
'login' => 'stty'
}
]
};
¿ÉÒÔ·¢ÏÖÈçϹæÂÉ£º
ÔªËصıêÇ©Ãû±»ÓÃÓÚhashµÄkey¡£
µ¥¸öÔªËصÄÄÚÈÝ×÷ΪhashµÄvalue£¬¶à¸öÖظ´µÄÔªËصÄÄÚÈݱ»·Åµ½Ò»¸öÊý×éÒýÓÃÖÐ×÷ΪhashµÄvalue
ÊôÐÔºÍ×ÓÔªËض¼ÒÔhashµÄkey=>value¶Ô³öÏÖÔÚÔªËصÄÄÚÈÝÖÐ
Ò»¸öÎÊÌâÊÇ£¬¶Ôµ¥¸öÔªËغͶà¸öÖظ´ÔªËصĴ¦Àí½á¹û²»Ò»Ö£¬¾Í»áµ¼ÖÂforeach´¦Àíʱ±È½ÏÂé·³
£¨ÐèÒªÇø·ÖÊDZêÁ¿»¹ÊÇÊý×éÒýÓã©£¬ÈçÉÏÃæµÄ text ºÍ user µÄÖµ¡£
½â¾ö·½·¨ÊÇÌí¼ÓÑ¡Ïî ForceArray => 1£¬¾Í¿ÉÒÔÇ¿ÖƵ¥¸öÔªËØÒ²·Åµ½Êý×éÒýÓÃÖС£
$xml = XMLin('sample.xml', ForceArray => 1);
print Dumper($xml);
ÔËÐнá¹û£¨²¿·Ö£©£º
$VAR1 = {
'text' => [
'This is a test.'
],
'user' => [
......
ÁíÒ»¸öÎÊÌâÊÇ£¬Èç¹ûÄãµÄÔªËØÊôÐÔÖаüº¬id¡¢name»òkey£¬ÄÇôԪËؾͲ»Ôٷŵ½Êý×éÒýÓÃÖУ


Ïà¹ØÎĵµ£º

JAVA¶ÁXML£ºsax,dom,jdom,dom4jµÄ±È½ÏÒÔ¼°Ñ¡Ôñ(ת)

JAVA¶ÁXML£ºsax,dom,jdom,dom4jµÄ±È½ÏÒÔ¼°Ñ¡Ôñ(ת)
Ô­ÎÄ£ºwww.hicourt.gov.cn/homepage/show9_content.asp
SAX£º                                 ......

xml¡¢xsdºÍxslÖ®¼äµÄ¹ØϵºÍʹÓÃʵÀý

¼òµ¥µØ˵£¬xslÊÇ˵Ã÷xmlÈçºÎ±í´ï³öÀ´µÄÑùʽÎļþ£¬¶øxsd¸ø³öxmlÎļþµÄ¸ñʽÃèÊö
Èç¹û˵xmlÊÇÒ»µþ³®Æ±£¬xsd¾ÍÊÇÑé³®»ú£¬¿´¿´ÀïÃæÓÐûÓмٳ®£¬¶øxslÊǵ㳮»ú£¬¿´¿´µ½µ×ÊǶàÉÙÇ®¡£ÓÃxml¿ÉÒÔ²»ÓÃxsd£¬¾ÍÏñ»¨Ç®µÄʱºò²»Ò»¶¨ÒªÑé³®Ò»Ñù£¬µ«ÊÇÊÕÇ®µÄÈËÒ»°ãÊÇÏëÒªÑéµÄ¡£¶ø»¨Ç®µÄʱºò²»Äܲ»µã³®£¬²»µãÄǾͲ»ÊÇ»¨Ç®ÁË£¬ÊÇÍæÇ®¡£µ±È»ÁË£ ......

vim html xml ×Ô¶¯²¹È«(ÔÚclosetag.vim ÉÏ×÷Á˵ãÐÞ¸Ä)

µ±ÊäÈë ¡·Ê±×Ô¶¯²¹È« µ±ÊäÈ롶/ʱ×Ô¶¯²¹È«
“£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
" File: closetag.vim
" Summary: Functions and mappings to close open HTML/XML tags
" Uses: <C-_> -- close matching open tag
" Author: Steven Mueller <di ......

socket, nio socket£¬¼°xml´«µÝobject ·½·¨

1£ºÈçºÎͨ¹ýsocket´úÀíÀ´·ÃÎÊ·þÎñ¶Ë£º
String proxyHost = 
"192.168.204.212"
;   

String proxyPort = 
"1080"
;   

  

//֪ͨJavaҪͨ¹ý´úÀí½øÐÐÁ¬½Ó¡£
ÕýÔÚ×°ÔØÊý¾Ý……
  

System.get ......

C#¶ÔxmlµÄ²Ù×÷ʵÀýÔ´Âë

À©Õ¹±ê¼ÇÓïÑÔXML£¨eXtensible Markup Language£©£¬ÊÇÓÉW3C×éÖ¯Öƶ¨µÄ¡£×öΪÓÃÓÚÌæ´úHTMLÓïÑÔµÄÒ»ÖÖÐÂÐ͵ıê¼ÇÓïÑÔ£¬XMLÄÚ²¿ÓÐןܶà»ù±¾±ê×¼£¬XML¾ÍÊÇͨ¹ýÓëÕâЩÏà¹Ø±ê×¼µØ½áºÏ£¬Ó¦ÓÃÓÚ¿Æѧ¼ÆËã¡¢µç×Ó³ö°æ¡¢¶àýÌåÖÆ×÷ºÍµç×ÓÉÌÎñµÄ¡£C££×÷ΪһÖÖÐÂÐ͵ijÌÐòÓïÑÔ£¬ÊÇ.Net¿ò¼ÜµÄÒ»¸öÖØÒª×é³É²¿·Ö£¬ËûºÍXMLµÄ¹ØϵÆÄÉî¡£±¾ÎÄ¾Í´Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ