当前位置:首页>网络学院>程序开发>XML教程>文章内容

xml ,xsl,css 之乱搞

[ 来源:www.it55.com | 作者: | 时间:2007-07-14 | 收藏 | 推荐 ] 【

做了一小段xml.与大家交流。
三个文件。(blue.xml blue.xsl blue.css )拷到本地同一目录下。 www.it55.com

blue.xml: www.it55.com在线教程

<?xml version='1.0' encoding='GB2312'?>
<?xml:stylesheet type='text/xsl' href='http://edu.iecool.com/show/blue.xsl'?>
<Topic>
  <Issue>
    <TopicId>000001</TopicId>
    <UserName>ycoe12</UserName>
    <RankName>超级用户</RankName>
    <TopicName>[JSP]Servlet中线程的问题</TopicName>
    <DateTime>2005-12-26 01:03:44</DateTime>
    <ReplyNum>2</ReplyNum>
    <ReadNum>68</ReadNum>
    <Content>请问一下怎样实现在Servlet里使用线程。比如用两线程,让一个线程与另一个线程通讯。
我的方法: implements Runnable 。生成后马上让它sleep。但是我不知道怎样让另一个线程在完成后通知此线程??(两个请求之间通讯)
我想在是通过检测HttpSession来判断另一个线程的进程的。但这样好像不太好。。。
谢谢</Content>
  </Issue>
<Replys> IT资讯之家 www.it55.com
  <Reply>
    <TopicID>000001</TopicID>
    <UserName>红色黑客</UserName>
    <RankName>经典杀手</RankName>
    <ReplyID>0001</ReplyID>
    <Content>这个应该用线程同步吧??</Content>
    <DateTime>2005-12-26 13:22:15</DateTime>
  </Reply>
  <Reply>
    <TopicId>000001</TopicId>
    <UserName>ycoe12</UserName>
    <RankName>超级用户</RankName> 
    <ReplyID>0002</ReplyID>
    <Content>不是,简单地说就是用一个线程完成后去通知另一个线程。。。不是,简单地说就是用一个线程完成后去通知另一个线程。。。不是,简单地说就是用一个线程完成后去通知另一个线程。。。</Content>
    <DateTime>2005-12-26 20:41:51</DateTime>
  </Reply>

IT资讯之家 www.it55.com

</Replys>
</Topic> www.it55.com

blue.xsl: http://www.it55.com/

<?xml version="1.0"  encoding="GB2312"?>
<!--
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="gb2312" version="4.0"/>
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="text()" >
<xsl:value-of/>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312"/>
<title><xsl:value-of select="Topic/Issue/TopicName"/></title>
<link REL='Stylesheet' HREF='http://edu.iecool.com/show/blue.css' TYPE='text/css'/>
</head>
<body>
<div id="divFrame">
 <div id="divTitle">
  <span id="spanTitleLeft"><xsl:value-of select="Topic/Issue/TopicName"/></span>
  <span id="spanTitleRight">作者:<xsl:value-of select="Topic/Issue/UserName"/> | <xsl:value-of select="Topic/Issue/RankName"/>| 发表时间:<xsl:value-of select="Topic/Issue/DateTime"/></span>

www.it55.com在线教程

 </div>
 <div id="divMain">
  <xsl:apply-templates select="Topic/Issue/Content" />
 </div>
 <div id="divReply">
  <xsl:apply-templates select="Topic/Replys"/>
 </div>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="Replys" >
 <xsl:for-each select="Reply"  >
  <div>
   <div id="replyPerson">回复人:<xsl:value-of select="UserName"/> | <xsl:value-of select="RankName"/>|</div>
   <div><xsl:apply-templates select="Content" /></div>
   <div>发表时间:<xsl:value-of select="DateTime"/></div>
  </div>
 </xsl:for-each>
</xsl:template>
<xsl:template match="Content">
 <xsl:apply-templates />
</xsl:template>
</xsl:stylesheet> www.it55.com在线教程

blue.css:

www.it55.com

body
{
 text-align:center;
 background-color:#ffffff;
}
div
{
 font-family:Verdana;
 text-align:left;
}
#divFrame
{
 background-color:#CCCCCC;
 width:95%;
 padding:8px;
}
#divTitle
{
 background-color:#F7F3F7;
 border:1px solid black;
 width:100%;
 font-size:16px;
 font-weight:bold;
 line-height:30px;
 color:#0051A5;
 padding-left:10px;
}
#divMain
{
 font-size:14px;
 margin-top:5px;
 border:1px solid black;
 padding:10px;

(编辑:IT资讯之家 www.it55.com

返回顶部
共2页: 上一页 1 [2] 下一页  

网友评论

[以下评论为网友观点,不代表本站。请自觉遵守互联网相关政策法规,所有连带责任均有评论者自负。]
[不超过250字]

图片文章