易截截图软件、单文件、免安装、纯绿色、仅160KB

Xml中的节点或属性值去空白

<Records>
<Record>
<id>1 </id>
<name>李四 </name>
</Record>
<Record>
<id>2 </id>
<name>张三 </name>
</Record>
<Record>
<id>3 </id>
<name>王五 </name>
</Record>
<Records>
我要取出张三的话,就需要知道张三的id的值,界面上取得的id是2 ,但是Xml文件中id是2还有个空格,这时候我们就要去除Xml文件中的空格了。
XmlNode node = document.SelectSingleNode("//Records/Record[normalize-space(@id)='2']);这样就可以了,也许有人问,为什么不加上空格就行了,这个我可以告诉你,如果Xml节点中的值有多个空格,这样如何处理呀?
W3cShool上还有许多函数,有兴趣可以去看看。


相关文档:

sqlserver FOR XML PATH 语句的应用

代码如下:

DECLARE
@TempTable table(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
运行这段脚本,将生成如下结果:
复制代码 ......

Asp.Net XML操作基类

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Xml;
using System.Text; ......

Loading XML data using ActionScript 3.0

Loading XML data using ActionScript 3.0
By Blue_Chi | Flash CS3 | ActionScript 3.0 | Beginner
Using XML is one of the best ways for structuring external content in a logical format that is easy to understand, process, and update. This tutorial will teach you the basics on how to load and process X ......

microsoft.xmldom(一) xml文档遍历js

xml:
<?xml version="1.0" encoding="utf-8" ?>
<library>
 <name>首都图书馆</name>
 <address>朝阳区华威桥南</address>
 <books>
  <book>
   <id>0000</id>
  </book>
  < ......

xml节点信息

xml: 
<?xml version="1.0" encoding="utf-8" ?>
<library>
 <name>首都图书馆</name>
 <address>朝阳区华威桥南</address>
 <books>
  <book type="math">
   <id>0000</id>
  </book&g ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号