ÓÃ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();
}
}
}
Ïà¹ØÎĵµ£º
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ÎļþÖжÁÈ¡ÅäÖÃÐÅÏ¢ÄØ£¿¸ÃÎÊÌâÔ´×ÔÒ»¼ÒÆóÒµµÄ±ÊÊÔÐÅÏ¢ÓиС£
Ò»xmlÎļþÄÚÈÝ£º
<?xml version="1.0" encoding="utf-8"?>
<root>
<db name="ClientDB1" datasize="512MB" datagrowth="100MB" logsize="100MB" loggrowth ="50MB">
</db>
<db ......
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Îļþ£¬¼´£º
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-do ......
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 ......