c#解析XML字符串
字符串内容如下:"<?xmlversion=\"1.0\"encoding=\"GB2312\"?><InHosptMainTellxslFileName=\"InHos...
字符串内容如下:"<?xml version=\"1.0\" encoding=\"GB2312\"?><InHosptMainTell xslFileName=\"InHosptMainTell_20040210095107.xsl\"><MainTell>胸闷3天,加重伴晕厥3小时。</MainTell></InHosptMainTell>" 取<MainTell>节点的内容(胸闷3天,加重伴晕厥3小时。)
xml是保存在ORACLE数据库中 C#解析后返回DataSet
(DataSet要包含XML各节点的名称和节点值)
<?xml version="1.0" encoding="GB2312"?><MHisDescript><individualMHis><txt_MRHistory>否认药物及食物过敏史。</txt_MRHistory></individualMHis><FaultHis_blood><txt_MRHistory>患者诉2年前开始出现双眼视物模糊。</txt_MRHistory></elapseMHis><FamilyHistory><txt_MRHistory>生于并长居广州,否认疫水接触史。</txt_MRHistory></FamilyHistory><MensesHistory><txt_MRHistory>平素生活起居有规律</txt_MRHistory></MensesHistory></MHisDescript> 展开
xml是保存在ORACLE数据库中 C#解析后返回DataSet
(DataSet要包含XML各节点的名称和节点值)
<?xml version="1.0" encoding="GB2312"?><MHisDescript><individualMHis><txt_MRHistory>否认药物及食物过敏史。</txt_MRHistory></individualMHis><FaultHis_blood><txt_MRHistory>患者诉2年前开始出现双眼视物模糊。</txt_MRHistory></elapseMHis><FamilyHistory><txt_MRHistory>生于并长居广州,否认疫水接触史。</txt_MRHistory></FamilyHistory><MensesHistory><txt_MRHistory>平素生活起居有规律</txt_MRHistory></MensesHistory></MHisDescript> 展开
4个回答
展开全部
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
xd.LoadXml("<?xml version=\"1.0\" encoding=\"GB2312\"?><InHosptMainTell xslFileName=\"InHosptMainTell_20040210095107.xsl\"><MainTell>胸闷3天,加重伴晕厥3小时。</MainTell></InHosptMainTell>");
Response.Write(xd.SelectSingleNode("InHosptMainTell/MainTell/text()").Value);
xd.LoadXml("<?xml version=\"1.0\" encoding=\"GB2312\"?><InHosptMainTell xslFileName=\"InHosptMainTell_20040210095107.xsl\"><MainTell>胸闷3天,加重伴晕厥3小时。</MainTell></InHosptMainTell>");
Response.Write(xd.SelectSingleNode("InHosptMainTell/MainTell/text()").Value);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
string filePath = "e:\\11.xml";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(filePath);
XmlNode root=xmlDoc.SelectSingleNode("InHosptMainTell");
XmlNode node = root.SelectSingleNode("MainTell");
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(filePath);
XmlNode root=xmlDoc.SelectSingleNode("InHosptMainTell");
XmlNode node = root.SelectSingleNode("MainTell");
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
看看 linq to xml 操作简单。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询