Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ÒýÇ ......

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

ÈçºÎ¼ÓÔØÓÐÍâ¹úºÍÌØÊâ×Ö·ûµÄÎĵµ£¿
¡¡¡¡Îĵµ¿ÉÒÔ°üº¬Íâ¹ú×Ö·û£¬ÀýÈ磺
 ¡¡¡¡foreign characters (úóí?) 
¡¡¡¡ÀýÈç íá µÄÍâ¹ú×Ö·û±ØÐëÔÚÇ°Ãæ¼ÓÉÏ escape ÐòÁС£Íâ¹ú×Ö·û¿ÉÒÔÊÇ UTF-8 ±àÂë»òÓò»Í¬±àÂëÖ¸¶¨£¬ÈçÏÂËùʾ£º
 ¡¡¡¡foreign characters (íá) 
¡¡¡ ......

XML½âÎö·½·¨½²½â

XMLÏÖÔÚÒѾ­³ÉΪһÖÖͨÓõÄÊý¾Ý½»»»¸ñʽ,ËüµÄƽ̨ÎÞ¹ØÐÔ,ÓïÑÔÎÞ¹ØÐÔ,ϵͳÎÞ¹ØÐÔ,¸øÊý¾Ý¼¯³ÉÓë½»»¥´øÀ´Á˼«´óµÄ·½±ã¡£¶ÔÓÚXML±¾ÉíµÄÓ﷨֪ʶÓë¼¼Êõϸ½Ú,ÐèÒªÔĶÁÏà¹ØµÄ¼¼ÊõÎÄÏ×,ÕâÀïÃæ°üÀ¨µÄÄÚÈÝÓÐDOM(Document Object Model),DTD(Document Type Definition),SAX(Simple API for XML),XSD(Xml Schema Definition),XSLT(Exten ......

xml ÉùÃ÷¡¾×¢ÊÍ¡¿ Òý·¢µÄÒì³£


xml -ÉùÃ÷-Òý·¢µÄÒì³£
XML ÉùÃ÷ [XML ±ê×¼]
XML ÉùÃ÷ͨ³£ÔÚ XML ÎĵµµÄµÚÒ»ÐгöÏÖ¡£XML ÉùÃ÷²»ÊDZØÑ¡Ïµ«ÊÇÈç¹ûʹÓà XML ÉùÃ÷£¬±ØÐëÔÚÎĵµµÄµÚÒ»ÐУ¬Ç°Ãæ²»µÃ°üº¬ÈκÎÆäËûÄÚÈÝ»ò¿Õ°×¡£
ÎĵµÓ³ÉäÖÐµÄ XML ÉùÃ÷°üº¬ÏÂÁÐÄÚÈÝ£º
°æ±¾ºÅ <?xml version="1.0"?>¡£
ÕâÊDZØÑ¡Ïî¡£¾¡¹ÜÒÔºóµÄ XML °æ±¾¿ÉÄÜ»á¸ü¸Ä¸Ã ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ