我爱Aspx >> XML/XLST >> 使用XML实现BBS(主题列表篇)表A:
1-0-1,this is a test
3-1-1,this is a test
4-3-1,this is a test
5-3-1,this is a test
2-0-2,this is a test
上面是BBS主题列表的一个例子。一般来说,假如不是使用Oracle(Oracle 有一条查询语句可以自动生成家族树,请查阅Select ... startwith ... connect by ...语句),那么如何实现上例的列表是一件费事的工作(相信许多程序员都写过)。
如果我们改用XML来实现,那么结果会怎么样呢?
现在我们使用"Select * from bbs"从数据库中查询贴子,并以XML格式返回(如果你是用ADO,那么可以用其RecordSet.Save ... adPersistXML直接生成,当然如果你不喜欢ADO生成的格式,可用程序生成,如本例):
表B:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://www.web521.com/XML/541468/b.xsl?>
<bbs>
<post sid="4" pid="3" aid="1">
<title>4-3-1,this is a test</title>
<content>slddfjslajfsdljf</content>
</post>
<post sid="5" pid="3" aid="1">
<title>5-3-1,this is a test</title>
<content>slddfjslajfsdljf</content>
</post>
<post sid="3" pid="1" aid="1">
<title>3-1-1,this is a test</title>
<content>slddfjslajfsdljf</content>
</post>
<post sid="1" pid="0" aid="1">
<title>1-0-1,this is a test</title>
<content>slddfjslajfsdljf</content>
</post>
<post sid="2" pid="0" aid="2">
<title>2-0-2,this is a test</title>
<content>slddfjslajfsdljf</content>
【我对这篇文章有话说?】
HTML中的XML数据岛记录编辑与添加[04-24]
利用xslt对xml进行缩进格式化处理[04-24]
获取mssql的xml返回结构的方法[04-24]
XML教程—编写结构完整的XML文档[04-24]
学习xml 之“先给个理由”[04-24]
原生XML数据库(NXD)为什么如此受..[04-21]
XML+SQL=数据库的未来?[04-21]
为什么XML文件的分析结果出现乱码..[04-21]
c#操作xml类[04-21]
在SQL Server中用XQuery分解XML数..[03-18]
HTML中的XML数据岛记录编辑与添加[04-24]
利用xslt对xml进行缩进格式化处理[04-24]
多级联动下拉选择框,动态获取下..[04-24]
获取mssql的xml返回结构的方法[04-24]
手把手教你制作Google Sitemap(详..[04-24]
Google Sitemap原来支持普通Feed[04-24]
XML教程—编写结构完整的XML文档[04-24]
学习xml 之“先给个理由”[04-24]
.NET大局观(第2版)[04-22]
ASP.NET 2.0技术内幕[04-22]