java xmlÎļþ½âÎö - Java / Eclipse
<categorys>
<item>
<type>ALL</ type>
<name>È«²¿ÐÅÏ¢</name>
</item>
<item>
<type>per</ type>
<name>ÐÅÏ¢</name>
<Tables>
<Table name="table1">
<Sys>ÐÅÏ¢1</Sys>
<Topic>ÐÅÏ¢</Topic>
<ID>AB002002</ID>
</Table>
</Tables>
</item>
<item>
<type>cor</ type>
<name>ÐÅÏ¢</name>
<Tables>
<Table name="table2">
<Sys>ÐÅÏ¢2</Sys>
<Topic>ÐÅÏ¢</Topic>
<ID>AA001020</ID>
</Table>
</Tables>
</item>
</categorys>
ÔÚ½âÎöÕâ¸öÎļþµÄʱºò¡£µ±½âÎöµ½<type>ALLʱºò¡£ÎÒÏ£Íû½«ÏÂÃæÁ½¸ö<type>perºÍ<type>corÀïÃæµÄ<Tables>¼ÓÈëµ½ÆäÖС£
¾ÍÊÇ˵allÀïÃæÒª°üº¬perºÍcorÀïtablesÀïµÄËùÓÐÔªËØ¡£
ÔÚ½âÎöµÄʱºò¸ÃÔõô´¦Àí£¿
ÓÃxpath
ºÃÏñÊÇ //type
ÓÃdom4J
document.selectNodes("//article")
Ïà¹ØÎÊ´ð£º
µ±ÖªµÀÒ»¸öÈÕÆÚ£¬ÈçºÎ°ÑÕâ¸öÈÕÆÚËùÔÚÑ®µÄǰºóÁ½¸öÈÕÆÚÈ¡³ö
±ÈÈçÊäÈë20090905£¬¾ÍÊäÈë20090901 20090910
Êä³ö20090901 20090910
È¡µÃÌìÊýºó×÷Ò»ÏÂÅжÏÔÙ°ÑÕâ¸ö·½·¨ÓÃÏÂvoid set(int field, int value)
......
ÏÖÔÚÓиöxmlÎļþÊÇ<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......