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

Êý¾Ý¿â²éѯ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 XML PATH
-----ÔËÐÐÕâ¶Î½Å±¾£¬½«Éú³ÉÈçϽá¹û£º
<row>
<UserID>1</UserID>
<UserName>a</UserName>
</row>
<row>
<UserID>2</UserID>
<UserName>b</UserName>
</row>
----´ó¼Ò¿ÉÒÔ¿´µ½Á½ÐÐÊý¾ÝÉú³ÉÁËÁ½¸ö½Úµã£¬ÐÞ¸ÄÒ»ÏÂPATHµÄ²ÎÊý£º
select UserID,UserName from TempTable FOR XML PATH('lzy')
----ÔÙ´ÎÔËÐÐÉÏÊö½Å±¾£¬½«Éú³ÉÈçϵĽá¹û£º
<lzy>
<UserID>1</UserID>
<UserName>a</UserName>
</lzy>
<lzy>
<UserID>2</UserID>
<UserName>b</UserName>
</lzy>
----¿ÉÒÔ¿´µ½½Úµã±ä³É£¬ÆäʵPATH() À¨ºÅÄڵIJÎÊýÊÇ¿ØÖƽڵãÃû³ÆµÄ£¬ÕâÑùµÄ»°´ó¼Ò¿ÉÒÔ¿´Ò»ÏÂÈç¹ûÊÇ¿Õ×Ö·û´®£¨²»ÊÇûÓвÎÊý£©»áÊÇʲô½á¹û?
select UserID,UserName from TempTable FOR XML PATH('')
----Ö´ÐÐÉÏÃæÕâ¶Î½Å±¾½«Éú³É½á¹û£º
<UserID>1</UserID>
<UserName>a</UserName>
<UserID>2</UserID>
<UserName>b</UserName>
---ÕâÑù¾Í²»ÏÔʾÉϼ¶½ÚµãÁË£¬
---´ó¼ÒÖªµÀÔÚ PATH ģʽÖУ¬ÁÐÃû»òÁбðÃû±»×÷Ϊ XPath ±í´ïʽÀ´´¦Àí£¬
---Ò²¾ÍÊÇ˵£¬ÊÇÁеÄÃû×Ö£¬ÕâÑù´óµ¨ÊÔÑéһϲ»¸øÖ¸¶¨ÁÐÃûºÍ±ðÃû»áÊÇÔõôÑù£¿
select cast(userid as varchar) +','+ username from TempTable for xml path('')
select CAST(UserID AS varchar) + '',UserName + '' from TempTable FOR XML PATH('')
---ÔËÐÐÉÏÃæÕâ¾ä½«Éú³É½á¹û
----1a2b
----ËùÓÐÊý¾Ý¶¼Éú³ÉÒ»ÐУ¬¶øÇÒ»¹Ã»ÓÐÁ¬½Ó×Ö·û£¬ÕâÑùµÄÊý¾Ý¿ÉÄܶԴó¼ÒûÓÐÓô¦£¬»¹¿ÉÒÔÔٱ仯һÏ£º
select CAST(UserID AS varchar) + ',',UserName + '',';' from TempTable FOR XML PATH('')
select CAST(userid as varchar) +',' +username +';' from TempTable for xml path('')
----Éú³É½á¹û
1,a;2,b;
----´ó¼ÒÏÖÔÚÃ÷°×ÁË°É£¬¿ÉÒÔͨ¹ý¿ØÖƲÎÊýÀ´Éú³É×Ô¼ºÏëÒªµÄ½á¹û£¬ÀýÈ磺
select '{' + CAST(UserID A


Ïà¹ØÎĵµ£º

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

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

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

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

Jdom ¶ÁÈ¡ xmlÎļþÀý×Ó


Jdom
¶ÁÈ¡
xml
ÎļþÀý×Ó
1.         
ÓÃ
JDOM
¶ÁÈ¡
XML
ÎļþÐèÏÈÓÃ
org.jdom.input.SAXBuilder
¶ÔÏóµÄ
build()
·½·¨´´½¨
Document
¶ÔÏó
,
È»ºóÓÃ
Document
Àà¡¢
Element
ÀàµÈµÄ·½·¨¶ÁÈ¡
1.
Sample1.java
import
java.util.*;
import
org.j ......

DataSet¡¢Excel¡¢XMLÖ®¼äµÄµ¼Èëµ¼³ö

class ImportExportToExcel
{
public class ImportExportToExcel
{
private string strConn;
private System.Windows.Forms.OpenFileDialog openFileDlg = new System.Windows.Forms.OpenFileDialog();
private System.Windows.Forms.SaveFileDialog saveFi ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ