很简单的例子:
先看下XML文档的基本格式
先看下XML文档的基本格式
Xml格式
<?xml version="1.0" encoding="utf-8" ?>
<books>
<book>
<author>Lucy</author>
<price>30</price>
<pubdate>05/08/2000</pubdate>
<publisher>清华大学出版社</publisher>
</book>
<book>
<author>Lily</author>
<price>40</price>
<pubdate>06/09/2001</pubdate>
<publisher>北京大学出版社</publisher>
</book>
<book>
<author>Jim</author>
<price>50</price>
<pubdate>07/10/2002</pubdate>
<publisher>南京大学出版社</publisher>
</book>
<book>
<author>Bruce</author>
<price>60</price>
<pubdate>08/11/2003</pubdate>
<publisher>上海大学出版社</publisher>
</book>
</books>
<?xml version="1.0" encoding="utf-8" ?>
<books>
<book>
<author>Lucy</author>
<price>30</price>
<pubdate>05/08/2000</pubdate>
<publisher>清华大学出版社</publisher>
</book>
<book>
<author>Lily</author>
<price>40</price>
<pubdate>06/09/2001</pubdate>
<publisher>北京大学出版社</publisher>
</book>
<book>
<author>Jim</author>
<price>50</price>
<pubdate>07/10/2002</pubdate>
<publisher>南京大学出版社</publisher>
</book>
<book>
<author>Bruce</author>
<price>60</price>
<pubdate>08/11/2003</pubdate>
<publisher>上海大学出版社</publisher>
</book>
</books>
在aspx文件中拖入一个XML控件,设置下DocumentSource属性即可!
不过Show出来的东东并没有把记录分开,而是连续的。如果要把记录分开,必须用XSL样式表。