Article View: cn.bbs.comp.xml
Article #7426����һ��XSL�������⣿
From: ����+����+����=����*�ڴ�ؼ�
Date: Mon, 21 Jul 2003 02:36
Date: Mon, 21 Jul 2003 02:36
215 lines
10510 bytes
10510 bytes
��һ��XSL�ļ���ʾһ��XML�ļ���
XSL�ļ���XML�ļ���û�и�ʽ����
������ʾʱ��XML�ļ���ʾ���˴�����ʹ�ü��� xsl:template����
������ʲô���⣿
BOW//
����ԭ�ļ���
XML�ļ�
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet href="SecondPage2.xsl" type="text/xsl"?>
<����������ҳ>
<��ҳ����>�����������</��ҳ����>
<ʱ����>�й�Ŵ���ʷ�Ϲ�Ԫ618��907�����ʱ��ij���Ϊ���ơ��������й���ʷ
�ϵĶ�ʢʱ�ڡ����Ƹ��濪�������������֮�Ρ���Զʢ������ʱ����Ӣ�Ŵ������
���ƣ�˿��֮·��ϵ�˶�����������һ�е�һ�������サ�������ݡ��ںϡ����ڻ��
�ɲ��õġ����Ļ���</ʱ����>
<���� id="001" ����="ʫ��">
<���� ��ƽ="701��762" ��ҳ="LibaiPage.xml">���</����>
<���>��ף��ƴ�ʫ̳�ϵ�һ�ž��ǣ���������˳�Ϊ��ʫ�ɡ����Ÿ���ʫ�䡰���侪
���꣬ʫ����������Ƕ����ʫ��߶ȳɾ͵�������������ѧϰ��Χ�ܹ㷺��
����Ҿ���\�Ŵ���ʷ�����⣬��������Ӱټ�֮�飬���á������������ŵ��̣��г���
����˼�룬ͬʱ���н�����ҵ�����α�����һ����Ĺ��£�ϣ��Ϊ��ҽ����������
����ʵ��</���>
<ͼƬ ��ҳ="LibaiPage.xml">Libai.gif</ͼƬ>
</����>
<���� id="002" ����="ʫ��">
<���� ��ƽ="712��770" ��ҳ="DufuPage.xml">�Ÿ�</����>
<���>�Ÿ����ҹ�ΰ��İ�������ʫ�ˣ�����һ���ԡ������ع١�������ѧ��ͳ�ļ�ͥ
�У�������ʫ�˶�����֮�7��ѧʫ��15������Ÿ�һ������������/�����ڵ�
����ʵ۵�ͳ�Σ����ʱ��Ҳ���Ƴ�����ʢת��˥��Ĵ�ʱ�ڡ��Ÿ���ΰ�����ʵ
����ʫ�������ʱ�����������ʵд�գ����кܸߵ���ѧ��ʷѧ��ֵ���������dz���
��ʫΪ��ʫʷ�����ƶŸ�Ϊ��ʫʥ����</���>
<ͼƬ ��ҳ="DufuPage.xml">Dufu.gif</ͼƬ>
</����>
<���� id="003" ����="˼���">
<���� ��ƽ="773��819" ��ҳ="LiuZYPage.xml">����Ԫ</����>
<���>����Ԫ������ٻ¼�ͥ�����в������д�־�����ԴDzɻ���Ϊ������Ԫ9���н�
ʿ��14��Dz�ѧ��ʿƣ��ڼ��͵����֡�һ��Ϊ����ο�����볯Ϊ�٣������������
�������θ��£�Ǩ��Ա���ɡ�����Ԫ��9�£�����ʧ�ܣ������ݴ��?11�¼ӱ�����˾
�?Ԫ��10�괺�ؾ�ʦ���ֳ�Ϊ���ݴ�ʷ��������14��11����������</���>
<ͼƬ ��ҳ="LiuZYPage.xml">Liuzy.gif</ͼƬ>
</����>
<���� id="004" ����="������">
<���� ��ƽ="686��760" ��ҳ="WuDZPage.xml">�����</����>
<���>����ӣ����������ˣ���������������������ӣ�����ϲ���滭����������
ǿ���Ҵ����ڷܡ���Ŭ������仭��ѧϰ�������������̣��ڲ���20���ʱ����
�������˻滭���ɺͼ��ա��ó����/���/����/ɽˮ/����/��ľ/¥��ȣ����侫�ڷ�
��/������ڱڻ����������ǡ��������桱֮һ�����С���ʥ��֮��������仭������
Ĥ��Ϊ����ʦ��/��������ˡ���</���>
<ͼƬ ��ҳ="WuDZPage.xml">WuDZ.gif</ͼƬ>
</����>
<���� id="005" ����="�ʵ�">
<���� ��ƽ="624-705" ��ҳ="WuZTPage.xml">������</����>
<���>�����죬������ˮ�ˣ��������ǣ���ͨ��ʷ��Ҳ������Ұ�ģ�ʹ����ı��ʹ�Ƹ�
�ڷϳ����ʺ�ûʺ�ĵ�λ�����ֳ�Ϊ�ҹ���ʷ�Ͻ��е�һλŮ�ʵۡ���������ִ
���İ�������У�������ĩũ����������ü���̫�����֮�ε춨�Ļ�Ҳ��������
����صĴ���˾�����ʹ����ʹ���ż��ţ�ִ����һЩ���н��Ե����ߣ�������
�ᾭ�ó��ֳ���չ�����ơ�</���>
<ͼƬ ��ҳ="WuZTPage.xml">WuZT.gif</ͼƬ>
</����>
<���� id="006" ����="�ʵ�">
<���� ��ƽ="598-649" ��ҳ="LiSMPage.xml">������</����>
<���>�Ƴ��ķ�������Ӧ�鹦���Ƴ��ĵڶ���ʵ���̫����������ԭ����쾵۵����
�������峯����������¶�����˵����βŻ����Ƴ��ճ������ã����ɱ���ֵܣ���ǿ
�ȸ�����Ԩ��λ����ʱ��28�ꡣ����λ��23�꣬��ȡ�����������ά��ͳһ�ͼ�ǿ��
��ר�Ƶ����δ�ʩ��ʹ��ʱ����ǰ���٣����÷��٣����⽻��Ƶ������ʷѧ�ҳ�����
�����֮�Ρ���</���>
<ͼƬ ��ҳ="LiSMPage.xml">LiSM.gif</ͼƬ>
</����>
</����������ҳ>
XSL�ļ�
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40">
<xsl:template match="/">
<html>
<xsl:element name="title">
<xsl:value-of select="����������ҳ/��ҳ����"/>
</xsl:element>
<style>
total
{
display:block;
position:absolute;
top:0px;
left:0px;
width:775px;
height:575px;
border:1px solid black;
}
title,.infor
{
display:block;
position:absolute;
}
title
{
top:0%;
left:0%;
width:10%;
height:100%;
padding-top:50%;
padding-left:18%;
background-color:red;
font-family:���Ŀ���;
font-size:45;
line-height:1.5;
color:yellow;
}
infor
{
top:0%;
left:10%;
width:90%;
padding-top:2%;
padding-left:2%;
padding-bottom:2%;
font-family:���Ŀ���;
font-size:18;
letter-spacing:1.5;
text-intent:36;
background-color:rgb(128,128,192);
color:white;
border:2px solid white;
}
star
{
display:block;
position:absolute;
overflow:auto;
top:24%;
left:10%;
width:90%;
height:76%;
}
name
{
display:block;
position:absolute;
background-color:rgb(128,128,192);
font-family:����;
font-size:18;
letter-spacing:2;
color:white;
}
intro
{
background-color:rgb(128,128,192);
font-size:12;
font-style:italic;
text-intent:24;
letter-spaing:1.5;
color:white;
}
href
{
display:block;
position:absolute;
top:20%;
left:84%;
font-family:����;
color:yellow;
</style>
<body>
<span class="total">
<xsl:for-each select="����������ҳ">
<xsl:apply-templates/>
</xsl:for-each>
<span class="total">
<table border="0" align="center" cellpadding="4" cellspacing="2" width="100%">
<tr bgcolor="red" style="color:yellow;">
<th width="20%">��ʷ����</th>
<th>������</th>
<th width="20%">��</th>
</tr>
<xsl:for-each select="����������ҳ/����">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:for-each>
<xsl:template match="����">
<td align="center" class="name">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="@��ҳ"/>
</xsl:attribute>
<xsl:value-of/>
</xsl:element>
<br/>
</td>
</xsl:template>
</table>
</span>
<a href="History.xml" class="href">�й������ʷ����</a>
</span>
</body>
</html>
</xsl:template>
<xsl:template match="��ҳ����">
<span class="title">
<xsl:value-of/>
</span>
</xsl:template>
<xsl:template match="ʱ����">
<span class="infor">
<xsl:value-of/>
</span>
</xsl:template>
</xsl:stylesheet>
--
[m[1;34m�� ��Դ:��BBS ˮľ�廪վ smth.org��[FROM: 202.38.233.111][m
Technical Details
Message-ID:
<000000$E8O@smth.org>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-05!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!SMTHShow Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB X-Google-Thread: 115571,b7a72bb58822be43,start X-Google-Attributes: gid115571,public X-Google-ArrivalTime: 2003-07-20 19:40:09 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-05!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!SMTH From: liaoren@smth.org (����+����+����=����*�ڴ�ؼ�) Newsgroups: cn.bbs.comp.xml Subject: ����һ��XSL�������⣿ Date: 21 Jul 2003 02:36:55 GMT Organization: BBS ˮľ�廪վ Message-ID: <000000$E8O@smth.org> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: XML/r/M.1058754721.A0 Lines: 215