ʹÓÃdom4j½âÎöXMLÀý×Ó
°üÀ¨Èý¸öÎļþ£ºstudentInfo.xml(´ý½âÎöµÄxmlÎļþ), Dom4jReadExmple.java(½âÎöµÄÖ÷ÒªÀà), TestDom4jReadExmple.java(²âÊÔ½âÎöµÄ½á¹û) £¨ÓÉÓÚʹÓÃcsdn blog×Ô´øµÄ´úÂëÕ³Ìù¹¤¾ß»á³¯Àï¼ÓÈëһЩ"..."×Ö·û£¬ËäÈ»ÀûÓڲ鿴£¬µ«ÊDz»ÀûÓÚ°Ñ´úÂëcopy³öÀ´ÔËÐУ¬¶øÇ××ÔÔËÐдúÂë¶Ô³ÌÐòÔ±À´ËµÊǺÜÖØÒªµÄ£¬¹ÊûÓÐʹÓÃcsdn blog×Ô´øµÄ´úÂëÕ³Ìù¹¤¾ßÀ´²åÈë´úÂ룬¶øÊÇÓÃ×ÅÓÃÖ±°×µÄ·½Ê½£©£º
studentInfo.xml
<?xml version="1.0" encoding="gb2312"?>
<students>
<student age="25"><!--Èç¹ûûÓÐageÊôÐÔ£¬Ä¬ÈϵÄΪ20-->
<name>´ÞÎÀ±ø</name>
<college>PCѧԺ</college>
<telephone>62354666</telephone>
<notes>ÄÐ,1982ÄêÉú,˶ʿ£¬Ï־ͶÁÓÚ±±¾©Óʵç´óѧ</notes>
</student>
<student>
<name>cwb</name>
<college leader="ѧԺÁìµ¼">PCѧԺ</college><!--Èç¹ûûÓÐleaderÊôÐÔ£¬Ä¬ÈϵÄΪleader-->
<telephone>62358888</telephone>
<notes>ÄÐ,1987ÄêÉú,˶ʿ£¬Ï־ͶÁÓÚÖйúÅ©Òµ´óѧ</notes>
</student>
<student age="45">
<name>xxxxx</name>
<college leader="">xxxѧԺ</college>
<telephone>66666666</telephone>
<notes>×¢ÊÓÖУ¬×¢ÊÍÖÐ</notes>
</student>
<student age="">
<name>lxx</name>
<college>y
Ïà¹ØÎĵµ£º
public partial class Form1 : Form
{
DataSet ds = new DataSet();
public Form1()
{
......
»¥ÁªÍø·¢Õ¹µÃºÜ¿ì£¬¶¼ÊÇÔ´×ÔÓÚʹÓÃÁ˳¬Îı¾µÄ±í´ï·½Ê½¡£±ÈÈçÄã²é¿´Ò»ÆªÎÄÕ£¬¿´µ½²»¶®µÄ¹Ø¼ü×Ö£¬¾Í¿ÉÒÔͨ¹ýÁ´½ÓÈ¥²é¿´ËüµÄÄÚÈÝ£¬¿´ÍêÖ®ºóÔÙ»ØÀ´½Ó×Å¿´ÔÀ´µÄ¶«Î÷£¬ÕâÑù±È½ÏÊʺÏѧϰµÄ·½Ê½¡£Ê¹ÓÃHTML±ê¼ÇµÄÎı¾£¬Êǽṹ»¯´¢´æµÄ£¬ÕâÑùµÄ±í´ï·½Ê½²Å¿ÉÒÔʵÏÖ³¬¼¶Á¬½Ó¡£ÓÉÓÚHTML¾ßÓг¬Ç¿µÄ±í´ïÄÜÁ¦£¬Ò²¾ÍÔÚ»¥ÁªÍøÉÏÉú´æÏÂÀ´£¬ÄÇ ......
LINQ to XML ¿ÉÒÔ¿´×÷ÊÇÒ»¸ö “better DOM” ±à³ÌÄ£ÐÍ£¬¿ÉÒÔºÍ System.Xml.dll ³ÌÐò¼¯Öеĺܶà³ÉÔ±½»»¥¡£
Ò»¡¢ÃüÃû¿Õ¼ä
System.Xml.Linq.dll ³ÌÐò¼¯¶¨ÒåÁËÈý¸öÃüÃû¿Õ¼ä£ºSystem.Xml.Linq, System.Xml.Schema ºÍ System.Xml.XPath
×îºËÐĵÄÊÇ System.Xml.Linq£¬ ¶¨ÒåÁ˶ÔÓ¦ XML Îĵµ¸ö·½ÃæµÄºÜ ......
ºÜ¶àÈ˶ÔXpath¿ÉÄܱȽÏÊìϤ£¬µ«²»ÖªµÀÓÐûÓÐÖ±½Ó²Ù×÷¹ýÊý¾Ý¿â£¬ÎÒÃǶ¼ÖªµÀ ÔÚSql2005À﹫֧³ÖµÄ¼¸ÖÖ²éѯÓÐRaw£¬Auto£¬PathģʽµÈ£¬Èç¹ûÔÚ2000ÀïʹÓùý PathģʽµÄÅóÓÑÓ¦¸ÃÖªµÀ£¬ÊDz»ÈÝÒ×´¦Àí²éѯ½á¹ûµÄ£¬ÄÇôÔÚ2005Àï¶ÔÕâÒ»¿é×öÁ˺ܺõÄÌáÉý
ÎÒÏÈÀ´½éÉÜÒ»ÏÂʲôÊÇSql¡¡F ......
¡¡¡¡±¾ÎÄÌÖÂÛSQL Server 2005µÄй¦ÄÜ£¬ËüÔÊÐíÄ㽫XMLÊý¾Ý·Ö½âµ½¹Øϵ¸ñʽÖУ¬¶ø²»±ØºÄÓÃÌ«¶àÄÚ´æ¡£
¡¡¡¡±¾ÎÄÌÖÂÛSQL Server 2005µÄй¦ÄÜ£¬ËüÔÊÐíÄ㽫XMLÊý¾Ý·Ö½âµ½¹Øϵ¸ñʽÖУ¬¶ø²»±ØºÄÓÃÌ«¶àÄÚ´æ¡£
¡¡¡¡ÔÚ¾ÙÀý˵Ã÷ÈçºÎ·Ö½âÉÏһƪÎÄÕÂÖеÄÊý¾Ýʱ£¬ÎÒÃÇÊ×ÏÈÁ˽âÒ»ÏÂXQueryºÍËüÔÚSQL Server 2005ÖÐΪ¿ª·¢ÕßÌṩµÄ¹¦ÄÜ¡£
¡ ......