高分求助!急.....................
最近小弟在做毕业设计,一个基于XML数据库的WEB授课课件系统,但是本人是第一次学习XML,在所做过程中遇到了一些小麻烦,请大家帮忙解决一下!愿意出高分!谢谢!
我的XML如下:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="PMS_Help.xsl"?>
<PMS_Help>
<Item>
<Name>cpu</Name>
<Para>大家好</Para>
<Image small="clsdfold.bmp">copen.bmp</Image>
<Para>你好</Para>
<Para>我好</Para>
<Item>
<Name>欢迎大家</Name>
<Item>
<Name>Welcome</Name>
<Para>大家好</Para>
<Image small="clsdfold.bmp">copen.bmp</Image>
<Para>你好</Para>
<Para>我好</Para>
</Item>
<Item>
<Name>大家好</Name>
<Para>湖南大学好</Para>
<Image small="clsdfold.bmp">copen.bmp</Image>
<Para>软件学院</Para>
<Para>湖南大学软件学院</Para>
</Item>
</Item>
<Item>
<Name>陈能</Name>
<Para>段革新</Para>
<Image small="copen.bmp">clsdfold.bmp</Image>
<Para>李泉</Para>
<Para>李子</Para>
</Item>
</Item>
<Item>
<Name>段革新</Name>
<Para>陈能</Para>
<Image small="copen.bmp">clsdfold.bmp</Image>
<Para>李泉</Para>
<Para>李子</Para>
</Item>
</PMS_Help>
xsl如下:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="PMS_Help">
<html>
<head>
<title>计算机微机与软维护授课课件</title>
<style media="screen, print">
<xsl:comment><![CDATA[
body {font-fimaly:'宋体',Arial; font-size:9pt; color:#000000;}
.Title1 {font-fimaly:'宋体'; font-size:17.2pt; color:#333333; font-weight:bold; margin-left:0pt; background-color:#eeeeee; white-space: nowrap}
.Title2 {font-fimaly:'宋体'; font-size:14pt; color:#000000; font-weight:bold; margin-left:0pt; white-space: nowrap}
.Title3 {font-fimaly:'宋体'; font-size:12pt; color:#333333; font-weight:bold; margin-left:90pt; background-color:#eeeeee; white-space: nowrap}
.Title4 {font-fimaly:'宋体'; font-size:12pt; color:#000000; font-weight:bold; margin-left:90pt; white-space: nowrap}
.Title5 {font-fimaly:'宋体'; font-size:10pt; color:#333333; font-weight:bold; margin-left:160pt; background-color:#eeeeee; white-space: nowrap}
.Title6 {font-fimaly:'宋体'; font-size:10pt; color:#000000; font-weight:bold; margin-left:160pt; white-space: nowrap}
.Para1 {font-fimaly:'宋体'; font-size:9pt; color:#333333; margin-left:90pt}
.Para2 {font-fimaly:'宋体'; font-size:9pt; color:#333333; margin-left:90pt}
.Para3 {font-fimaly:'宋体'; font-size:9pt; color:#333333; margin-left:90pt}
.Para4 {font-fimaly:'宋体'; font-size:9pt; color:#333333; margin-left:90pt}
.Para5 {font-fimaly:'宋体'; font-size:9pt; color:#333333; margin-left:160pt}
.Para6 {font-fimaly:'宋体'; font-size:9pt; color:#333333; margin-left:160pt}
.image {cursor:hand}]]></xsl:comment>
</style>
<script>
<xsl:comment><![CDATA[
/* 当用户点击图片时,交替显示缩略图和全图 */
function swapImg(which, small, normal){
var s = "/";
//alert(which + '|' + small + '|' + normal);
//alert(which.src.substring(which.src.lastIndexOf(s)+1));
if (which.src.substring(which.src.lastIndexOf(s)+1) == small){
which.src = '../image/' + normal;
which.alt = '===> 缩小 <===';
}
else{
which.src = '../image/' + small;
which.alt = '<=== 放大 ===>';
}
}
]]></xsl:comment>
</script>
</head>
<body>
<a name="top"/>
<h2>计算机微机与软维护</h2>
<p align="right">
<a href="mailto:duangexin@etang.com">EMail to us</a>
<xsl:text> </xsl:text>
<a href="javascript:print()">打印本手册</a>
</p>
<xsl:for-each select="Item">
<xsl:apply-templates select="."/>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template match="Item">
<xsl:variable name="allParentNode" select="ancestor::Item/Name"/>
<xsl:variable name="allChildNode" select="child::Item/Name"/>
<xsl:variable name="numOfAllParentNode" select="count($allParentNode) + 1"/>
<xsl:variable name="numOfAllChildNode" select="count($allChildNode)"/>
<!-- output the content of help -->
<!-- 显示各级标题 -->
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number count="Item" level="multiple" format="01-01-01"/></xsl:attribute>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="class"><xsl:value-of select="concat('Title', $numOfAllParentNode)"/></xsl:attribute>
<xsl:number count="Item" level="multiple"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Name"/>
<!-- 级别为奇数的标题下加横线 -->
<xsl:if test="$numOfAllParentNode = 1 or ($numOfAllParentNode mod 2) != 0">
::<a href="#top" target="_self">top</a>
<hr size="1" noshade="noshade"/>
</xsl:if>
</xsl:element>
<p/>
<!-- 如果还存在下一级Item,则递归调用此模板 -->
<xsl:if test="count(Item)>0">
<xsl:apply-templates select="Item"/>
</xsl:if>
<!-- 如果不存在下一级标题,显示段落和图片内容 -->
<xsl:if test="count(Item)=0">
<xsl:apply-templates select="Para | Image"/>
</xsl:if>
</xsl:template>
<xsl:template match="Para | Image">
<xsl:variable name="allParentNode" select="ancestor::Item/Name"/>
<xsl:variable name="numOfAllParentNode" select="count($allParentNode) + 1"/>
<!-- 如果节点是Para,显示段落 -->
<xsl:if test="self::Para">
<xsl:element name="div">
<xsl:attribute name="class"><xsl:value-of select="concat('Para', $numOfAllParentNode)"/></xsl:attribute>
<p>
<xsl:value-of select="."/>
</p>
</xsl:element>
</xsl:if>
<!-- 如果节点是Image,显示图片 -->
<xsl:if test="self::Image">
<xsl:variable name="small" select="normalize-space(@small)"/>
<xsl:variable name="normal" select="normalize-space(.)"/>
<xsl:element name="div">
<xsl:attribute name="class"><xsl:value-of select="concat('Para', $numOfAllParentNode)"/></xsl:attribute>
<xsl:element name="img">
<xsl:choose>
<xsl:when test="boolean($small)">
<xsl:attribute name="src">../image/<xsl:value-of select="$small"/></xsl:attribute>
<xsl:attribute name="alt"><=== 放大 ===></xsl:attribute>
<xsl:attribute name="onclick"><xsl:value-of select="concat('swapImg(this, "',$small,'","',$normal,'")')"/></xsl:attribute>
</xsl:when>
<xsl:when test="not(boolean($small))">
<xsl:attribute name="src">../image/<xsl:value-of select="$normal"/></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:attribute name="class">image</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:element>
<p/>
</xsl:element>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
问题:
1.怎么我的图片无法显示?请问我哪里出错了?
2.怎么章下面的概述内容无法显示?只能显示节下面的内容?
本人很急,请大家帮帮!愿意给高分!