XML¶ÁÈ¡ÎÊÌâ - Web ¿ª·¢ / ASP
<?xml version="1.0" encoding="UTF-8" ?>
<list version="3.0">
<title>title</title>
<book>
<type>
<id>1022</msgid>
<name>66</name>
</type>
......
<type>
<id>1023</id>
<name>77</name>
</type>
</book>
</list>
¶ÁÈ¡£º
Set XML = Server.CreateObject ("Microsoft.XMLDOM")
xml.async = False
xml.Load Request
set root=xml.documentElement
title= root.childNodes.item(0).text
Set oXMLItems = root.selectNodes("book")
oXMLtype=oXMLItems(0).selectNodes("type")
iLength = oXMLtype.length - 1
For i = 0 To iLength
Set oXMLItem = oXMLmessages.item(i)
id= oXMLItem.getAttribute("id")
name= oXMLItem.getAttribute("name")
Next
¸ßÊÖÖ¸µã´íÔÚÄİ¡¡£¡£¡£
<?xml version="1.0" encoding="UTF-8" ?>
<list version="3.0">
<title>title</title>
<book>
<type>
<id>1022</msgid>
<name>66</name>
Ïà¹ØÎÊ´ð£º
ÎÒÔÚ±àдһ¸öwince5.0µÄ³ÌÐò£¬ÏëʵÏÖ°ÑPDAÉϵÄÒ»¸öLIST <STRING>ÀàÐ͵ÄÊý¾ÝÐòÁл¯ÎªXML£¬È»ºóÔÚPCÉϵÄÒ»¸öwebserviceÄõ½Õâ¸öXML£¬×ª»¯ÎªDataset£¬¸üÐÂPCÉϵÄÊý¾Ý¿â£¬ÎÒÏëÎÊÔõô°ÑXML´«¸øwebserviceµÄÄØ£¿
......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
package com.javabean.xml;
import java.net.MalformedURLException;
import java.net.URL;
import org.dom4j.io.SAXReader;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.Docum ......
xmlÎļþ¸ñʽÈçÏÂ
XML code:
<?xml version="1.0" encoding="GB2312" ?>
<allproducts version="1.0">
<products>
<product name="prodId&quo ......
String strXML="<all><student><name>ΰ¸ç</name><sex>ÄÐ</sex><age>27</age></student><student><name>qiaoqiao</name><sex> ......