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

¡¾×ª¡¿+¡¾¸Ä¡¿DOM4J´¦ÀíXML´øÓÐÃüÃû¿Õ¼äµÄËÄÖÖ·½·¨

µ±Äã½âÎöXMLʱ£¬ÊÇ·ñ»áÒòΪÃüÃû¿Õ¼äµÄ´æÔÚ¶ø²»Äܵó¥ËùÔ¸ÄØ£¿
java·½Ã棬ºÃ¶àÈËÍƼöÓÃdom4j´¦Àíxml£¬ÎÒÒ²¾Í˵˵ÔÚdom4jÉÏ´¦Àí´øÃüÃû¿Õ¼äµÄxml
xml´úÂëexample: ÔÙ˵ǰÈýÖÖ·½·¨£¬Ò²ÊÇ´ÓÍøÉÏ¿´À´µÄ¡£http://www.cnblogs.com/patrickchen/articles/1188920.html
D: eport.css
µÚÒ»¸ö·½°¸.ÉèÖÃÄãµÄxpathµÄÃüÃû¿Õ¼äsetNamespaceURIs
1: public class TransferXML { 2: public static void main(String[] args) throws Exception{ 3: Map map = new HashMap(); 4: map.put("design","http://www.eclipse.org/birt/2005/design"); 5: SAXReader saxReader = new SAXReader(); 6: File file = new File("D:\test.xml"); 7: Document document = saxReader.read(file); 8: XPath x = document.createXPath("//design:list-property"); 9: x.setNamespaceURIs(map); 10: List nodelist = x.selectNodes(document); 11: System.out.println(nodelist.size()); 12: } 13: }
µÚ¶þ¸ö½â¾ö·½°¸:ÉèÖÃÄãµÄDocumentFactory()µÄÃüÃû¿Õ¼ä setXPathNamespaceURIs
1: public class TransferXML { 2: public static void main(String[] args) throws Exception{ 3: Map map = new HashMap(); 4: map.put("design","http://www.eclipse.org/birt/2005/design"); 5: SAXReader saxReader = new SAXReader(); 6: File file = new File("D:\test.xml"); 7: saxReader.getDocumentFactory().setXPathNamespaceURIs(map); 8: Document document = saxReader.read(file); 9: List tmp = document.selectNodes("//design:list-property"); 10: System.out.println(tmp.size()); 11: } 12: }
µÚÈýÖÖ·½·¨£º±¾ÈËÓõģ¬×ҲÊÇ×îͨÓõķ½·¨£¬¾ÍÊDz»Ê¹Óÿª·¢»·¾³¸øÄãÌṩµÄһϵÁжÔÏ󣬶øÊÇÓÃXPathÓï·¨ÖÐ×Ô´øµÄlocal-name() ºÍ namespace-uri() Ö¸¶¨ÄãҪʹÓõĽڵãÃûºÍÃüÃû¿Õ¼ä¡£
µ±ÄãÓöµ½Ê¹ÓÃxsltÀ´Ñùʽ»¯xmlʱ£¬¾ÍÖªµÀÕâ¸ö±¿·½·¨µÄºÃ´¦ÁË£º
1: public class TransferXML { 2: public static void main(String[] args) throws Exception 3: SAXReader saxReader = new SAXReader(); 4: File file = new File("D:\test.xml")


Ïà¹ØÎĵµ£º

wxwidgets ÓÃxmlÀ´ÃèÊö½çÃ棬ÔÚ³ÌÐòÀï»ñÈ¡ ±äÁ¿ºÍʼþ

Èç¹û¶Ô½çÃæÃÀ¹Û³ÌÐò±È½Ï¸ß£¬ÊÖд´úÂëÊDz»¿É±ÜÃâµÄ¡£
µ«Èç¹û×öµÄÊÇһЩÏñÖ»ÊÇΪÁËÏÔʾ¡¢¿ØÖÆÖ®ÀàµÄ³ÌÐò£¬¿ÉÄܸü¿ìµÄ°Ñ³ÌÐòµ·¹Ä³öÀ´¾ÍºÃÁË¡£
wxwidgets
ÓÐÕâÑùµÄÒ»¸ö¹¦ÄÜ£¬¾ÍÊÇÄÜÓÃxmlд³É½çÃæ¾ÍÄÜÏÔʾ
±à¼­xrcµÄ¹¤¾ßÊÇwxformbuilder,¿ªÔ´Ãâ·ÑµÄ£¬Ò²×ã¹»ÓÃÁË£¬ÎÒÒ»¿ªÊ¼Ã»ÕÒµ½Ôõô
Éú³Éxrc,ºóÀ´Ä³´ÎżȻ¿´µ½ÁËÏÂÃæ....Ô­À ......

DataTable.Select½øÐÐXMLÊý¾ÝµÄ²éѯ

×î½üÔÚ²©¿ÍÔ°´úÂëµÄÖع¹ÖÐ, ÎÒ·¢¾õÓÃDataTable.Select½øÐÐXMLÊý¾ÝµÄ²éѯҲÊÇͦ·½±ãµÄ¡£
±ÈÈçÎÒÃǸù¾ÝUrlÖвÎÊýÖµ²éѯXMLÊý¾ÝÖÐÏàÓ¦½ÚµãµÄÊý¾Ý¡£
¼ÙÈçÎÒÃÇÓÐÕâÑùµÄXmlÊý¾ÝÎļþCatalog.xml:
<Navigation>
      <Catalog title="·Ç¼¼ÊõÇø" url="default.aspx?cate=2" rss="MainFeed.as ......

Flexµ÷ÓÃÔ¶³ÌXMLÊý¾Ý

Ê×ÏÈÒªÓÐÒ»¸ö¼òÒ׵ķþÎñÆ÷£¬½¨Á¢Ò»¸öÕ¾µã£¬È»ºóÕ¾µãÏ´æ·Å 
1£ºcrossdomain.xml Õâ¸öÊÇ¿çÓëÓò²ßÂÔÎļþ£¬ÓÃÓÚÖ¸¶¨Óòͨ¹ýFlash
Player·ÃÎʱ¾ÓòµÄ×ÊÔ´(Èç¹û·þÎñÆ÷ÔÚ±¾»ú¾ÍûÓÐÕâ¸ö±ØÒª)µ«ÊÇÔ¶³ÌµÄ»°¾ÍÒª(½¨ÒéÒª)
ÎļþÄÚÈÝ£º
<cross-domain-policy>
  <allow-access-from domain="*" /> ......

XML ÊôÐÔvsÔªËØ

Çë¿´ÏÂÃæµÄʾÀý£º
<person sex="female">
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person>
<person>
<sex>female</sex>
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person> ......

Êý¾Ý¿â²éѯXML½á¹¹£¬FOR XML PATH Óï¾äµÄÓ¦ÓÃ


/*
Êý¾Ý¿â²éѯXML½á¹¹£¬FOR XML PATH Óï¾äµÄÓ¦ÓÃ
*/
FOR XML PATH Óï¾äµÄÓ¦ÓÃ:
CREATE  TABLE TempTable(UserID int , UserName nvarchar(50));
insert into TempTable (UserID,UserName) values (1,'a')
insert into TempTable (UserID,UserName) values (2,'b')
select UserID,UserName from TempTable FOR ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ