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

½âÎö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</wap2>
<width>115</width>
</mobile>
<mobile type="Nokia6108">
<wap2>false</wap2>
<width>115</width>
</mobile>
</mobile-list>
-----------------------------------------------------
-----------------------------------------------------
ʹÓÃjdom¶ÁxmlÎļþ£º
package com.pk.xml;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
public class JDOMxml {
public static void main(String[] args) throws JDOMException, IOException {
try{
//»ñÈ¡½âÎöÆ÷
SAXBuilder builder = new SAXBuilder();
//½âÎöÎļþ
File file = new File("D:\\ÏîÄ¿\\me\\mobilelist.xml");
Document document = builder.build(file);
//È¡¸ù½Úµã
Element root = document.getRootElement();
//È¡µÄ½ÚµãÁбí
List books = root.getChildren();
for(int i = 0 ; i<books.size();i++){
//È¡µÃijһ¸ö½Úµã
Element book = (Element) books.get(i);
//»ñÈ¡ÊôÐÔÖµ
String type = book.getAttributeValue("type");
System.out.print(type+"\t");

String text = book.getChild("wap2").getText();
String texts = book.getChild("width").getText();
System.out.print(text+"\t");
System.out.println(texts+"\t");
}
}catch (Exception e) {
e.printStackTrace();


Ïà¹ØÎĵµ£º

XMLÓÐÄÄЩÓÃ;?

XMLÊDZ»Éè¼ÆΪ´æ´¢¡¢´«ÊäÒÔ¼°½»»»Êý¾ÝµÄ¡£XML²»ÊDZ»Éè¼ÆΪÓÃÀ´ÏÔʾÊý¾ÝµÄ¡£
¡¡¡¡XML¿ÉÒÔ½«HTMLÓëÊý¾Ý·ÖÀë
¡¡¡¡Í¨¹ýʹÓÃXML£¬ÄúµÄÊý¾Ý¿É´æ´¢ÓÚHTMLÖ®Íâ¡£
¡¡¡¡µ±ÎÒÃÇʹÓÃHTMLÀ´ÏÔʾÊý¾Ýʱ£¬Êý¾Ý´æ´¢ÓÚHTMLÖС£Í¨¹ýʹÓÃXML£¬Êý¾Ý¿ÉÒÔ±»´æ´¢ÔÚµ¥¶ÀµÄXMLÎļþÖС£ÕâÑù×öµÄ»°£¬Äú¾Í¿ÉÒÔ°Ñ×¢ÒâÁ¦¼¯ÖÐÔÚʹÓÃHTML½øÐÐÊý¾Ý²¼¾Öº ......

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

ÔÚ XML ¶ÔÏóÄ£ÐÍÖÐÈçºÎ´¦Àí¿Õ°××Ö·û£¿
¡¡¡¡ÓÐЩʱºò£¬XML ¶ÔÏóÄ£Ðͽ«ÏÔʾ°üº¬¿Õ°××Ö·ûµÄ TEXT ½Úµã¡£¿Õ°××Ö·û±»½Ø¶Ïºó£¬¶à°ë»á´øÀ´Ò»Ð©»ìÂÒ¡£ÀýÈçÏÂÃæµÄ XML Àý×Ó£º
 ¡¡¡¡]>
¡¡¡¡Smith
¡¡¡¡John
 
¡¡¡¡Éú³ÉÏÂÁÐÊ÷£º
 ¡¡¡¡Processing Instruction: xml
¡¡¡¡DocType: person
¡¡¡¡ELEMENT: person ......

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){

......

xml/propertiesÎļþµÄÏ໥±£´æת»¯

/*
Á·Ï°Ê¹ÓÃjava.util.propertiesÀà°üÀ´²Ù×÷propertes¼°XMLÎļþ,ͨ¹ýstore·½·¨µÄµ÷ÓÿÉʵÏÖxml/propertiesÎļþµÄÏ໥±£´æת»¯
*/
import java.util.*;
import java.io.*;
public class TestPropertes
{
public static void main(String[] args) {
   Properties pp = new Properties();
   Fi ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ