ËÄÖÖXML½âÎö·½·¨
ËÄÖÖXML½âÎö·½·¨
xmlÎļþ£º
£¼?xml version="1.0" encoding="GB2312"?£¾
£¼RESULT£¾
£¼VALUE£¾
£¼NO£¾A1234£¼/NO£¾
£¼ADDR£¾ËÄ´¨Ê¡XXÏØXXÕòXX·X¶ÎXXºÅ£¼/ADDR£¾
£¼/VALUE£¾
£¼VALUE£¾
£¼NO£¾B1234£¼/NO£¾
¡¡ ¡¡£¼ADDR£¾ËÄ´¨Ê¡XXÊÐXXÏçXX´åXX×飼/ADDR£¾
£¼/VALUE£¾
£¼/RESULT£¾
1£©DOM
import java.io.*;
import java.util.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
public class MyXMLReader{
¡¡public static void main(String arge[]){
long lasting =System.currentTimeMillis();
try{
¡¡File f=new File("data_10k.xml");
¡¡DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
¡¡DocumentBuilder builder=factory.newDocumentBuilder();
¡¡Document doc = builder.parse(f);
¡¡NodeList nl = doc.getElementsByTagName("VALUE");
¡¡for (int i=0;i£¼nl.getLength();i++){
System.out.print("³µÅƺÅÂë:" +
doc.getElementsByTagName("NO").item(i).getFirstChild().getNodeValue());
System.out.println("³µÖ÷µØÖ·:" +
doc.getElementsByTagName("ADDR").item(i).getFirstChild().getNodeValue());
¡¡ ¡¡}
}catch(Exception e){
¡¡e.printStackTrace();
}
import java.io
Ïà¹ØÎĵµ£º
ͨ¹ýAsp.net(C#)Ó¦ÓóÌÐò¶ÁÈ¡±¾µØÉÏ´«µÄExcleÎļþ,´æ·Åµ½DataSetÖÐ,ͨ¹ýDataSetÖеķ½·¨Ö±½ÓÉú³ÉXMLÎļþ.
C# Code
if (this.FileUpload1.PostedFile != null)
{
string filename = this.FileUpl ......
ʹÓÃXML changeÐÞ¸ÄxmlÎļþµÄ»ù±¾²½Öè
(½öÏÞÓÚInstallscript MSIÏîÄ¿ÒÔ¼°Basic MSIÏîÄ¿)
1.µ¼ÈëXMLÎļþ¡£ÔÚSystem ConfigurationÊÔͼÖÐÑ¡ÔñXML File Changes£¬ÓÒ¼üXML
File¡£Ñ¡ÔñImport£¬¿ÉÒÔÆô¶¯Import XML
wizard¡£NextÖ®ºó£¬Ñ¡ÔñÐèÒªµ¼ÈëµÄXMLÎļþ£¨¿ÉÒÔÔÚÏÂÀ¿òÖÐÑ¡ÔñÀàÐÍ£©¡£NextÖ®ºó£¬Select
ALL¡£Èç¹ûÑ¡Ôñ²¿·Ö£ ......
ÓÃTXT±à¼ÁËÒ»¸öXMLÎĵµ
<?xml version="1.0" encoding="utf-8"?>
<TEST>"
<Test Value="ÕâÊÇÒ»¸ö²âÊÔ" />
</TEST>
ÓÃIE´ò¿ªµÄʱºòÒ»Ö±ÏÔʾÓдíÎó£¬ÏÔʾººÓï×Ö·û²»Ö§³Ö¡£
¸ÄΪencoding=“gb2312”ºóÏÔʾÕý³£ÁË¡£
µ«Õâ¸ö½á¹ûÓë³õÖÔÎ¥±³£¬ÒòΪUTF-8ÊÇÖ§³ÖËùÓÐÓïÑԵġ£
ºóÀ´²éÕÒÔÒ ......