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

ÓÃDom4jÀ´½âÎöxmlÎļþ

package com.pk.xml;
import java.io.File;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class Dom4j {
public static void main(String[] args) {
try {
//»ñµÃSAX½âÎöÆ÷
SAXReader reader = new SAXReader();

//½âÎöÎļþ
File file = new File("D:\\ÏîÄ¿\\me\\mobilelist.xml");
Document document = reader.read(file);
//»ñÈ¡¸ú½Úµã
Element root = document.getRootElement();
//»ñµÃ×Ó½ÚµãÁбí
for(int i = 0 ; i<root.nodeCount();i++){
//È¡µÃijһ¸ö×Ó½Úµã
Element book = (Element) root.node(i);
//È¡µÃÊôÐÔÖµ
String type = book.attributeValue("type");
System.out.print(type+"\t");

String wap2 = book.node(0).getText();
String wedint = book.node(1).getText();
System.out.print(wap2+"\t");
System.out.println(wedint+"\t");
}
} catch (Exception e) {
e.printStackTrace();
}

}
}


Ïà¹ØÎĵµ£º

XMLÈëÃŵij£¼ûÎÊÌâ(¶þ)

Internet Explorer 5.0 ¶Ô XML ÌṩÄĸö¼¶±ðµÄÖ§³Ö£¿
¡¡¡¡Internet Explorer 5 ÌṩÏÂÁÐ XML Ö§³Ö£º
¡¡¡¡Ö±½Ó²é¿´ XML¡£Microsoft XML ʵÏÖÔÊÐíÓû§Í¨¹ýËûÃÇµÄ Web ä¯ÀÀÆ÷ʹÓà XSL »òÕß²ãµþÑùʽ±í (CSS) ²é¿´ XML£¬¾ÍÏó²é¿´ HTML ÎĵµÒ»Ñù¡£
¡¡¡¡¸ßÐÔÄÜ¡¢ÑéÖ¤ XML ÒýÇæ¡£Internet Explorer 4.0 ¿ª·¢ÈËÔ±ÊìϤµÄ XML ÒýÇ ......

Sqlserver£º´ÓXMLÎļþÖжÁÈ¡ÅäÖÃÐÅÏ¢

ÈçºÎÔÚSqlserverÖдÓÍⲿXMLÎļþÖжÁÈ¡ÅäÖÃÐÅÏ¢ÄØ£¿¸ÃÎÊÌâÔ´×ÔÒ»¼ÒÆóÒµµÄ±ÊÊÔÐÅÏ¢ÓиС£
Ò»xmlÎļþÄÚÈÝ£º
<?xml version="1.0" encoding="utf-8"?>
<root>
  <db name="ClientDB1" datasize="512MB" datagrowth="100MB" logsize="100MB" loggrowth ="50MB">
  </db>
  <db ......

flex xmlºÍarraycollectionÏ໥ת»»

1¡¢arraycollectionת»¯Îªxml£¬´úÂëÈçÏ£º
    
    //¶¯Ì¬Éú³ÉÊ÷Ðνṹ
public static function flatArrayToXML(arr:Object,rootname:String=null,nodename:String=null, outputString:Boolean=false):Object{
if (arr is Array){

......

¹ØÓÚflexµÄcrossdomain.xmlÎļþ´æ·ÅĿ¼

       ×î½üÔÚÏîÄ¿ÖÐÓöµ½flex¿çÓò·ÃÎʵݲȫɳÏäÎÊÌ⣬²é×ÊÁÏÁ˽⵽ÐèÒªÔÚ·þÎñ¶Ë¼ÓÉÏcrossdomain.xmlÎļþ£¬¼´£º
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-do ......

ÓÃdomÀ´½âÎöxmlÎļþ

xmlÎļþΪ£º
<?xml version="1.0" encoding="UTF-8"?>
<mobile-list>
<mobile type="Nokia2652">
<wap2>false</wap2>
<width>115</width>
</mobile>
<mobile type="Nokia2650">
<wap2>false</wa ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ