问题描述
<?xmlversion="1.0"encoding="utf-8"?>-<root>-<!--项目:id为唯一标识,name为项目名称-->-<projectid="01"name="熙街一期">-<!--楼栋,ID为唯一标识,name为楼栋名称-->-<buildingname="东大楼"id="1">-<!--楼层,name为楼层名称-->-<floorname="1">-<!--单元,name为单元名称-->-<unitname="01">-<!--UnityID这是虚拟现实房间编号-->-<!--房间,id为房间唯一标识-->---><roomUnityID="1"id="47"name="101"Prerentconstructionarea="1600"Actualconstructionarea="1600"Prerentsetinsidearea="1500"Measuredsetinsidearea="1500"Constructionarea="1600"Setinsidearea="1400"Valuationway="建筑面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton="很好,业主不错的选择"Status="小订"PlanUrl=""Proprietor="潭波"ShopName="中国农业银行"/><roomUnityID="1"id="48"name="102"Prerentconstructionarea="2000"Actualconstructionarea="2000"Prerentsetinsidearea="1890"Measuredsetinsidearea="1890"Constructionarea="2000"Setinsidearea="1800"Valuationway="套内面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton=""Status="签约"PlanUrl=""Proprietor="老李"ShopName="永辉超市"/></unit>+<unitname="02"><roomUnityID="1"id="49"name="101"Prerentconstructionarea="1600"Actualconstructionarea="1600"Prerentsetinsidearea="1500"Measuredsetinsidearea="1500"Constructionarea="1600"Setinsidearea="1400"Valuationway="建筑面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton="很好,业主不错的选择"Status="小订"PlanUrl=""Proprietor="潭波"ShopName="中国农业银行"/><roomUnityID="1"id="50"name="102"Prerentconstructionarea="2000"Actualconstructionarea="2000"Prerentsetinsidearea="1890"Measuredsetinsidearea="1890"Constructionarea="2000"Setinsidearea="1800"Valuationway="套内面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton=""Status="签约"PlanUrl=""Proprietor="老李"ShopName="永辉超市"/></unit></floor>+<floorname="2">+<unitname="01"><roomUnityID="1"id="47"name="101"Prerentconstructionarea="1600"Actualconstructionarea="1600"Prerentsetinsidearea="1500"Measuredsetinsidearea="1500"Constructionarea="1600"Setinsidearea="1400"Valuationway="建筑面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton="很好,业主不错的选择"Status="小订"PlanUrl=""Proprietor="潭波"ShopName="中国农业银行"/><roomUnityID="1"id="48"name="102"Prerentconstructionarea="2000"Actualconstructionarea="2000"Prerentsetinsidearea="1890"Measuredsetinsidearea="1890"Constructionarea="2000"Setinsidearea="1800"Valuationway="套内面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton=""Status="签约"PlanUrl=""Proprietor="老李"ShopName="永辉超市"/></unit>+<unitname="02"><roomUnityID="1"id="49"name="101"Prerentconstructionarea="1600"Actualconstructionarea="1600"Prerentsetinsidearea="1500"Measuredsetinsidearea="1500"Constructionarea="1600"Setinsidearea="1400"Valuationway="建筑面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton="很好,业主不错的选择"Status="小订"PlanUrl=""Proprietor="潭波"ShopName="中国农业银行"/><roomUnityID="1"id="50"name="102"Prerentconstructionarea="2000"Actualconstructionarea="2000"Prerentsetinsidearea="1890"Measuredsetinsidearea="1890"Constructionarea="2000"Setinsidearea="1800"Valuationway="套内面积"Decoratingastandard=""Decorateunitprice=""Decorateaparagraph=""Constructionunitprice="2"Setinsidetheunitprice="2"Standardprice="4"Familycommenton=""Status="签约"PlanUrl=""Proprietor="老李"ShopName="永辉超市"/></unit></floor></building>-<buildingname="西大楼"id="2">+<floorname="1">+<unitname="01"><roomUnityID="1"id="47"name="101"/><roomUnityID="1"id="48"name="102"/></unit>-<unitname="02"></unit></floor>+<floorname="2">+<unitname="01"></unit>-<unitname="02"></unit></floor></building></project>+<projectid="02"name="熙街二期">+<buildingname="东大楼"id="1">+<floorname="1">+<unitname="01"></unit>-<unitname="02"></unit></floor>-<floorname="2">-<unitname="01"></unit>-<unitname="02"></unit></floor></building>+<buildingname="西大楼"id="2">+<floorname="1">-<unitname="01"></unit>-</floor>-</building></project></root>这种怎么读取,我想先读取root下的所有project节点在页面上展示“熙街一期","熙街二期"等用table或者用repeater控件展示在通过点击”一期“或则其他进入另一个页面显示下一节点然后在读取building节点展示在点击
解决方案
解决方案二:
用dataset或者xmldatadocument都可以对xml进行读取。
解决方案三:
XmlDocumentxml=newXmlDocument();xml.Load("XXXX.xml");XmlNodeListxmlNodeList=xmlLoad.SelectNodes("root/project[id='1']");//查找root下id=1的节点XmlNodexmlNode=xmlNodeList.Item(0);stringtxt=xmlNode["name"].InnerText;//显示东大楼
解决方案四:
最简单的,datatableaa=xx.readXml();
解决方案五:
你可以参考类似的方法
解决方案六:
LZ去我的博客看看吧写的很详细
解决方案七:
跟着学习学习
解决方案八:
我也想知道
解决方案九:
linqtoxml