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

ÏÂÃæµÄxmlÎļþÔõô¶Á£¿

<Employee>
      <Employee   code= "2003 ">
                <a> fdsafdsaf </a>
                <b> dascvxvc <b>
      </Employee>
      <Employee   code= "2010 ">
                <a> fdsafdsaf </a>
                <b> dascvxvc <b>
      </Employee>
</Employee>
ÈçºÎ¶Á³öÑ­»·¶Á³öcodeºÍËû½ÚµãϵÄÊý¾Ý
ÓÃjavaScript¶Á°É

stringbufferÀà¶ÁÈ¡

dom4j,¿ÉÒÔÖ±½Ó²Ù×÷°É,Éú³É,½âÎö.

ÓÐûÓиüÏêϸµÄ¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£

µ½ÍøÉÏÏ¿ªÔ´°ü¡£
DOM£¬dom4j,...

SAXBuilder saxbuilder = new SAXBuilder();
try
{
Document document =saxbuilder.build("src\\work\\company.xml"); //»ñµÃÎļþ·¾¶
Element element =document.getRootElement();//»ñµÃ¸ùÔªËØ
List list = element.getChildren("dept");//»ñµÃ×ÓÔªËØ
for(int i=0;i <list.size();i++){//ʹÓÃforÑ­»·±éÀúÿһ¸öÔªËØµÄÖµ

Element element1 = (Element) list.get(i);//»ñµÃÿһ¸öÔªËØ
String dept_id =element1.getAttributeValue("dept_id");
St


Ïà¹ØÎÊ´ð£º

javascript ÈçºÎÔÚ±¾µØ´´½¨¶ÁдxmlÎļþ£¿

ÐèÒª¼æÈÝie firefox safari µÈä¯ÀÀÆ÷
IE ¿ÉÒÔÓÃFSO µ«ÊÇÔÚÆäËûä¯ÀÀÆ÷²»ÄÜÓÃ
Ò»°ãµÄä¯ÀÀÆ÷´¦ÓÚ°²È«¿¼ÂǶ¼²»ÔÊÐíJavaScript¶Áд±¾µØÎļþµÄ°É

XMLÎĵµÄÚÈÝÈçÏ£¨user.xml£©£º
<?xml version="1.0&qu ......

XML¶ÔÏóÓëXMLList¶ÔÏóÓÐÊ²Ã´Çø±ð£¿[

XML¶ÔÏóÓëXMLList¶ÔÏóÓÐÊ²Ã´Çø±ð£¿[
¹ËÃû˼Ò壬XMLList¾ÍÊÇÒ»¸öLIST£¬ÊÇÒ»¸ö¼¯ºÏ¡£

List °üº¬XMLÖеÄËùÓÐÔªËØ£¬ÓÃList¿ÉÒÔ·ÃÎÊXML¸ùÔªËØÏµÄ×ÓÔªËØ

ÒýÓÃ
List °üº¬XMLÖеÄËùÓÐÔªËØ£¬ÓÃList¿ÉÒÔ·ÃÎÊXML¸ùÔª ......

¶Ôxml½øÐнâÎö±àÂëÎÊÌâ

ÎÒµÄXMLÅäÖÃÎļþÀïÃæÓÐÖÐÎÄ×Ö·û,Ò²ÓÐÀàËÆÓÚ=~@!ÕâÖÖ×Ö·û,encodeingÉèÖÃΪgb2312  ºÍ  unicode,unicode  UTF-8,½á¹û¶¼Ìáʾϵͳ´íÎó,,,Èç¹ûÉèÖÃΪgb2312µÄ»°,È¥µô=!@ÕâÖÖ×Ö·û,Ò»Çж¼Õý³£.
ÓÉÓÚÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ