xml½âÎö
xml
<mime>
<content>
<type>text/plain</type>
<big>357</big>
<text>D:\\cybercourttext2009101410241364.txt</text>
</content>
<content>
<type>text/plain</type>
<big>357</big>
<text>D:\\cybercourttext2009101410241364.txt</text>
</content>
</mime>
½âÎö
XmlDocument myDoc = new XmlDocument();
myDoc.LoadXml(xmlcontent);
//ËÑË÷Ö¸¶¨µÄ½Úµã
System.Xml.XmlNodeList mimenodes = myDoc.SelectNodes("//content");
for (int i = 0; i < mimenodes.Count; i++)
{
string type = mimenodes[i].FirstChild.InnerText;//»ñÈ¡contentϵĵÚÒ»¸ö½Úµã
string text = mimenodes[i].LastChild.InnerText;//»ñÈ¡contentϵÄ×îºóÒ»¸ö½Úµã
}
Ïà¹ØÎĵµ£º
var createXML = function (str) {
if (typeof DOMParser !== "undefined") {
return (new DOMParser()).parsefromString(str, "application/xml");
}else if (typeof ActiveXObject != "undefined") {
if (typeof arguments.callee.activeXString !== "string" ......
ʹÓÃdom4j½âÎöXMLʱ£¬Òª¿ìËÙ»ñȡij¸ö½ÚµãµÄÊý¾Ý£¬Ê¹ÓÃXPathÊǸö²»´íµÄ·½·¨£¬dom4jµÄ¿ìËÙÊÖ²áÀïÒ²½¨ÒéʹÓÃÕâÖÖ·½Ê½£¬±êÌⶼдµÄÕâôÀ«Æø£ºPowerful Navigation with XPath£¬ºÇºÇ¡£
·½·¨ÊÇʹÓÃDocumentµÄselectNodes(String XPath)·½·¨£¬´úÂëд·¨£º
List l = doc.selectNodes("//COLS/COL1");
Ö´ÐÐʱȴÅ׳öÒÔÏÂÒì³££º
Exc ......
StringBuilder output = new
StringBuilder();
String xmlString =
@"<bookstore>
<book genre='novel' ISBN='10-861003-324'>
<title>The Handmaid's Tale</title>
<price>19.95</price>
</book>
<book genre='novel' ISBN='1-861001-57-5' ......
SAX¸ÅÄî
SAXÊÇSimple API for XML
µÄËõд£¬Ëü²¢²»ÊÇÓÉW3C¹Ù·½ËùÌá³öµÄ±ê×¼£¬¿ÉÒÔ˵ÊÇ“Ãñ¼ä”µÄÊÂʵ±ê×¼¡£Êµ¼ÊÉÏ£¬ËüÊÇÒ»ÖÖÉçÇøÐÔÖʵÄÌÖÂÛ²úÎï¡£ËäÈ»Èç´Ë£¬ÔÚXMLÖжÔSAXµÄÓ¦ÓÃË¿ºÁ²»±ÈDOMÉÙ£¬¼¸ºõËùÓеÄXML½âÎöÆ÷¶¼»áÖ§³ÖËü¡£
Óë
DOM±È½Ï¶øÑÔ£¬SAXÊÇÒ»ÖÖÇáÁ¿Ð͵ķ½·¨¡£ÎÒÃÇÖªµÀ£¬ÔÚ´¦ÀíDOMµÄʱºò£¬Î ......
JAVA¶ÁXML£ºsax,dom,jdom,dom4jµÄ±È½ÏÒÔ¼°Ñ¡Ôñ(ת)
ÔÎÄ£ºwww.hicourt.gov.cn/homepage/show9_content.asp
SAX£º ......