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

¶ÔÓÚ´øÓбí¿Õ¼äxmlnsµÄxmlÎļþµÄ½âÎö

¶ÔÓÚ´øÓбí¿Õ¼äxmlnsµÄxmlÎļþµÄ½âÎö£¬ÓÃÕý³£½âÎöÎļþµÄ·½·¨×ÜÊÇʧЧ£¬²»Æð×÷Óã¬ÎÞ·¨»ñµÃÔªËØ¡£
ÏÂÃæ¸ø³öÁ½ÖÖ·½·¨½âÎö´ËÀàÎļþ£º
1.°´Õý³£½âÎöxmlÎļþµÄ·½·¨£¬ÐèҪעÒ⼸µã£º
»ñÈ¡ÔªËØElement£¬²»¿ÉʹÓú¯Êý£ºdocument.selectNodes("//region");
Ö»¿ÉÒÔÏÈÈ¡µ½¸ùÔªËØ£¬Ò»¼¶Ò»¼¶ÍùÏÂÈ¡£¬eg£º
Element root = document.getRootElement();
Element ele = root.element("head");
»ñÈ¡ÊôÐÔÖµ£¬¿ÉÒÔ°´Ò»°ãµÄ·½·¨²Ù×÷£¬eg£º
List ll = document.selectNodes("//@regionName");
  System.out.println("ll.size=" + ll.size());
2.ʹÓÃXPath¡£eg:
public void testHasNameSpace(File file) {
SAXReader saxReader = new SAXReader();
Document document = null;
// XmlDocument document=
try {
document = saxReader.read(file);
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HashMap xmlMap = new HashMap();
xmlMap.put("smil", "http://www.w3.org/2000/SMIL20/CR/Language");
XPath x = document.createXPath("//smil:region");
x.setNamespaceURIs(xmlMap);
List regionList = x.selectNodes(document);
System.out.println("there are " + regionList.size() + " regions");
XPath att = document.createXPath("//smil:region/@regionName");
att.setNamespaceURIs(xmlMap);
List attrList = att.selectNodes(document);
System.out.println("there are " + attrList.size() + " attrs");
int i = 0;
Iterator it = attrList.iterator();
while (it.hasNext()) {
Attribute a = (Attribute) it.next();
System.out.println((i++) + "¸ö£º" + a.getValue());
}
}


Ïà¹ØÎĵµ£º

ASP.NET/XMLÉîÈë±à³Ì¼¼Êõ

ÕâÊǹØÓÚAsp.Net/XMLÉîÈë±à³ÌµÄ¼¼ÊõÊ飬×÷Õß¾«ÐÄÉè¼ÆÁË66¸öʵÀýÏêϸ½éÉÜÁË.Net   FrameworkÒÔ¼°XML¼¼ÊõÔÚ.Net   FrameworkµÄ±à³Ì·½·¨ºÍ¼¼ÇÉ¡£È«ÊéÓÉ12Õ¹¹³É£¬ÄÚÈݰüÀ¨.Netƽ̨µÄ½¨Á¢¡¢Asp.NetµÄWeb   Forms¡¢¿Ø¼þ¡¢Êý¾Ý·ÃÎÊ¡¢Web   Service¡¢Asp.NetµÄÉèÖú͸ú×Ù¡¢Asp.NetµÄ°²È« ......

VC²Ù×÷XML±à³ÌʵÀý

ת×Ô£ºhttp://www.cnblogs.com/sadier/articles/99875.html
ÎÄÕÂÕýÎÄ
 
ǰ¶Îʱ¼ä£¬ÓÉÓÚ¹¤×÷µÄÐèÒª£¬ÀûÓõ½ÁËXML£¬ËùÒÔ¶ÔÆä½øÐÐÁËһЩ¼òµ¥µÄÑо¿¡£ÔÚ´ËÔ¸°ÑһЩÐĵÃд³öÀ´£¬Óë¸÷λ·ÖÏí£¬²»¶ÔµÄµØ·½»¹Íû¶à¶à°üº­¡£ 
1.ʲôÊÇ XML? 
Ê×ÏÈ£¬ÎÒÏë¸÷λӦ¸Ã¶¼ÒѾ­´ó¸ÅÖªµÀʲôÊÇXMLÁË¡£Èç¹û£¬Äã¶Ôʲà ......

FusionCharts µÄXML±êÇ©ÊôÐÔ

FusionCharts µÄ XML±êÇ©ÊôÐÔÓÐÒ»ÏÂËÄÖÖÊý¾ÝÀàÐÍ
* Boolean - ²¼¶ûÀàÐÍ£¬Ö»ÄÜΪ1»òÕß0¡£ÀýÈ磺<graph showNames=’1′ >
* Number - Êý×ÖÀàÐÍ£¬Ö»ÄÜΪÊý×Ö¡£ÀýÈ磺<graph yAxisMaxValue=’200′ >
* String - ×Ö·û´®ÀàÐÍ£¬Ö»ÄÜΪ×Ö·û´®¡£ÀýÈ磺 <graph caption=’My Chart&rsqu ......

·ÖÎöASP.NET¶ÁÈ¡XMLÎļþ4ÖÖ·½·¨

·½·¨Ò» £ºÊ¹ÓÃXML¿Ø¼þ
<% @ Page Language="C#"%>
<html>
<body>
<h3><font face="Verdana">¶ÁÈ¡XML·½·¨Ò»</font></h3>
<from runat=server>
<asp:Xml id="xml1" DocumentSource="grade.xml" runat="server" />
</from>
</body>
</ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ