ÔÚXMLÊý¾ÝÖвåÈë»Ø³µ»»ÐÐ×Ö·û
ÔÚXMLÊý¾ÝÖУ¬Ò»Ð©ÌØÊâ×Ö·û±ØÐëÓÃתÒå·ûºÅÀ´´úÌæ£¬¶ø»Ø³µ»»ÐÐ×Ö·û¾ÍÊÇÊôÓÚÌØÊâ·ûºÅ¡£
¿Õ¸ñ ( )
Tab (	)
»Ø³µ (
)
»»ÐÐ (
)
ÏÂÃæÊÇÒ»¸ö±¨±íXMLÊý¾Ý£¬ÀïÃæ°üÀ¨Óлسµ»»ÐÐ×Ö·û£º
<report>
<NewDataSet>
<Table>
<CustomerID>BLONP</CustomerID>
<CompanyName>¹úð©</CompanyName>
<ContactName>»ÆÑÅÁá</ContactName>
<ContactTitle>Êг¡¾Àí</ContactTitle>
<Address>¹ã·¢±±Â·
10 ºÅ</Address>
<City>´óÁ¬</City>
<Region>¶«±±</Region>
<PostalCode>565479</PostalCode>
<Country>Öйú</Country>
<Phone>(0671) 88601531</Phone>
<Fax>(0671) 88601532</Fax>
</Table>
<Table>
<CustomerID>CACTU</CustomerID>
<CompanyName>Íþº½»õÔËÓÐÏÞ¹«Ë¾</CompanyName>
<ContactName>ÁõÏÈÉú</ContactName>
<ContactTitle>ÏúÊÛ´úÀí</ContactTitle>
<Address>¾Æßγ¶þ· 13 ºÅ</Address>
<City>´óÁ¬</City>
<Region>¶«±±</Region>
<PostalCode>120412</PostalCode>
<Country>Öйú</Country>
<Phone>(061) 11355555</Phone>
<Fax>(061) 11354892</Fax>
</Table>
</NewDataSet>
<_grparam>
<StaticBox1>µÚÒ»ÐÐÎÄ×Ö
µÚ¶þÐÐÎÄ×Ö</StaticBox1>
</_grparam>
</report>
<Address>¹ã·¢±±Â·
10 ºÅ</Address> - “10 ºÅ”֮ǰ¾Í°üº¬Á˻سµ»»ÐзûºÅ
<StaticBox1>µÚÒ»ÐÐÎÄ×Ö
µÚ¶þÐÐÎÄ×Ö</StaticBox1> - “µÚ¶þÐÐÎÄ×֮֔ǰ¾Í°üº¬Á˻سµ»»ÐзûºÅ
XMLÖл¹ÓкܶàÌØÊâ×Ö·û£¬¶¼ÒªÓÃתÒå·ûºÅÀ´´úÌæ¡£Èç¹ûÊDZà³ÌÉú³ÉXMLÊý¾Ý£¬Í¨³£¶¼Óк¯Êý»á×Ô¶¯´¦Àíת»»ÌØÊâ·ûºÅ¡£
Ïà¹ØÎĵµ£º
1¡¢³õʼ»¯
Load µ¼ÈëÒ»¸öXMLÎļþµ½CMarkupµÄ¶ÔÏóÖУ¬²¢¶ÔËü½øÐнâÎö¡£ÀàËÆC#µÄLoad¡£
SetDoc ´Ó×Ö·û´®Öе¼ÈëXMLÊý¾Ý£¬²¢¶ÔËü½âÎö¡£ÀàËÆC#µÄLoadXml¡£
2¡¢Êä³ö
Save ½«XMLÊý¾ÝдÈëÎļþÖС£ÀàËÆC#µÄSave¡£
GetDoc ½«Õû¸öXMLÊý¾ÝÎĵµ×÷Ϊ×Ö·û´®·µ»Ø¡£
3¡¢¸Ä±äµ±Ç°Î»ÖÃ
FindElem ¶¨Î»µ½ÏÂÒ»¸öÔªËØ£¬¿ÉÄܺÍÒ»¸ö±êÇ©Ãû»ò· ......
.dtdÎļþÖÐÈç¹ûÓÐÖÐÎÄ,±ØÐëÁí´æÎªUTF-8±àÂë
ÎÊÌâ:
TransformerFactoryΪ³éÏóÀà,²»ÄÜnewʵÀý,µ«ÌṩÁË·½·¨À´»ñµÃ
TransformerFactory factory = TransformerFacory.newInstance();
factory.newDocumentBuilder();
ÕâÀïnewDocumentBuilder()Ϊ³éÏó·½·¨,ΪʲôÄܵ÷ÓÃÄØ?
×¢Òâ:ÕâÀïfactory±äÁ¿Ö¸ÏòµÄÊÇÒ»¸öʵÀý,´ËʵÀýÊ ......
sql2005ÖÐÒ»¸öxml¾ÛºÏµÄÀý×Ó ÊÕ²Ø
¸ÃÎÊÌâÀ´×ÔÂÛ̳ÌáÎÊ£¬ÑÝʾSQL´úÂëÈçÏÂ
--½¨Á¢²âÊÔ»·¾³
set nocount on
create table test(ID varchar(20),NAME varchar(20))
insert into test select '1','aaa'
insert into test select '1','bbb'
insert into test select '1','ccc'
insert into test select '2','ddd'
inser ......
XMLµÄËÄÖÖ½âÎöÆ÷ÔÀí¼°ÐÔÄÜ±È½Ï ......