所以我有一个像下面这样的CSS文件
.table_class1DeffCell
{
border-top-width : 1;
border-left-width : 1;
border-right-width : 1;
border-bottom-width : 1;
}
.table_class11DeffCell
{
border-bottom-color : 000000;
border-top-color : 000000;
border-right-color : 000000;
border-left-color : 000000;
border-top-style : solid;
border-left-style : solid;
border-right-style : solid;
border-bottom-style : solid;
border-top-width : 1;
border-left-width : 1;
border-right-width : 1;
border-bottom-width : 1;
}
.table_class24DeffCell
{
border-bottom-color : 000000;
border-top-color : 000000;
border-right-color : 000000;
border-left-color : 000000;
border-top-style : solid;
border-left-style : solid;
border-right-style : solid;
border-bottom-style : solid;
border-top-width : 1;
border-left-width : 1;
border-right-width : 1;
border-bottom-width : 1;
}
.text_class40
{
font-style : italic;
}
.text_class41
{
font-weight : bold;
}
.image_class42
{
}
在HTML中它的链接如下
<link rel="stylesheet" type="text/css" href="FormatingProblem.css"></link>
由于链接CSS文件,HTML BOLD和斜体中的正常工作。
实际上我正在将HTML文件转换为Word文档,在这种情况下我无法执行这些BOLD和斜体。
这是我的XSLT文件
<table width="100%">
<tr>
<xsl:if test="@class=$TableClass">
<!--left Table Cell-->
<xsl:choose>
<!--Requirement-->
<xsl:when test="td[@class=$RequirementType]/span/span/. = 'Non Functional' or td[@class=$RequirementType]/span/span/. = 'Functional' or td[@class=$RequirementType]/span/span/. = 'Scenario' or td[@class=$RequirementType]/span/span/. = 'Actor'">
<td style="border-Top: black 1.0pt solid; border-Bottom: #4896a black 1.0pt solid; vertical-align:'top'" bgcolor = "#DDD9C3" width="80%">
<!--Text-->
<xsl:if test="td/@class=$Requirements">
<xsl:for-each select="td[@class=$Requirements]/span/span | td[@class=$Requirements]/span/br | td[@class=$Requirements]/span/blockquote">
<span>
<xsl:if test="name() != 'br'">
<xsl:value-of select="." />
<xsl:if test="name() = 'blockquote'">
<br/>
</xsl:if>
</xsl:if>
<xsl:if test="name() = 'br'">
<br/>
</xsl:if>
</span>
</xsl:for-each>
</xsl:if>
<br />
<br />
<!--Reference-->
<xsl:if test="td/@class=$References">
<xsl:if test="string-length(td[@class=$References]/span/span)!=0">
<span>
<br />
<xsl:for-each select="td[@class=$References]/span/span | td[@class=$References]/span/br">
<span>
<xsl:if test="name() != 'br'">
<xsl:value-of select="." />
</xsl:if>
<xsl:if test="name() = 'br'">
<br/>
</xsl:if>
</span>
</xsl:for-each>
</span>
</xsl:if>
</xsl:if>
<br />
<br />
</td>
</xsl:when>
</xsl:choose>
<!--right Table Cell-->
<xsl:choose>
<!--Requirement-->
<xsl:when test="td[@class=$RequirementType]/span/span/. = 'Functional' or td[@class=$RequirementType]/span/span/. = 'Non Functional' or td[@class=$RequirementType]/span/span/. = 'Scenario' or td[@class=$RequirementType]/span/span/. = 'Actor'">
<xsl:choose>
<!--Search 1-->
<xsl:when test="td[@class=$Auxiliary]/span[contains(span, $search1)]">
<td style="vertical-align:'top'" bgcolor="{$search1Color}" width="20%">
<span style="font-size:8pt">
<!--UID_ATR-->
<xsl:if test="td/@class=$UID">
ID:
<xsl:value-of select="td[@class=$UID]/." />
</xsl:if>
<br />
<!--TFS_ID-->
<xsl:if test="td/@class=$TFS_ID">
TFS:
<xsl:value-of select="td[@class=$TFS_ID]/." />
</xsl:if>
<br />
<!--TFS_Triage-->
<xsl:if test="td/@class=$Triage">
<xsl:value-of select="td[@class=$Triage]/." />
</xsl:if>
<br />
<!--V. In-->
<xsl:if test="td/@class=$V.In">
<xsl:value-of select="td[@class=$V.In]/." />
</xsl:if>
<br />
<!--TFS_Priority-->
<xsl:if test="td/@class=$Priority">
(Prio
<xsl:value-of select="td[@class=$Priority]/." />)
</xsl:if>
<br />
<!--TFS_Requirement Type-->
<xsl:if test="td/@class=$RequirementType">
<xsl:value-of select="td[@class=$RequirementType]/." />
</xsl:if>
<br />
<br />
<!--Auxiliary-->
<xsl:if test="td/@class=$Auxiliary">
<xsl:value-of select="td[@class=$Auxiliary]/." />
<br />
</xsl:if>
<br />
</span>
</td>
</xsl:when>
<!--Search 2-->
<xsl:when test="td[@class=$Auxiliary]/span[contains(span, $search2)]">
<td style="vertical-align:'top'" bgcolor="{$search2Color}" width="20%">
<span style="font-size:8pt">
<!--UID_ATR-->
<xsl:if test="td/@class=$UID">
ID:
<xsl:value-of select="td[@class=$UID]/." />
</xsl:if>
<br />
<!--TFS_ID-->
<xsl:if test="td/@class=$TFS_ID">
TFS:
<xsl:value-of select="td[@class=$TFS_ID]/." />
</xsl:if>
<br />
<!--TFS_Triage-->
<xsl:if test="td/@class=$Triage">
<xsl:value-of select="td[@class=$Triage]/." />
</xsl:if>
<br />
<!--V. In-->
<xsl:if test="td/@class=$V.In">
<xsl:value-of select="td[@class=$V.In]/." />
</xsl:if>
<br />
<!--TFS_Priority-->
<xsl:if test="td/@class=$Priority">
(Prio
<xsl:value-of select="td[@class=$Priority]/." />)
</xsl:if>
<br />
<!--TFS_Requirement Type-->
<xsl:if test="td/@class=$RequirementType">
<!--Zeilenumbruch-->
<xsl:value-of select="td[@class=$RequirementType]/." />
</xsl:if>
<br />
<br />
<!--Auxiliary-->
<xsl:if test="td/@class=$Auxiliary">
<xsl:value-of select="td[@class=$Auxiliary]/." />
<br />
<!--Zeilenumbruch-->
</xsl:if>
<br />
</span>
</td>
</xsl:when>
<!--No Search-->
<xsl:otherwise>
<td style="vertical-align:'top'" width="20%">
<span style="font-size:8pt">
<!--UID_ATR-->
<xsl:if test="td/@class=$UID">
ID:
<xsl:value-of select="td[@class=$UID]/." />
</xsl:if>
<br />
<!--TFS_ID-->
<xsl:if test="td/@class=$TFS_ID">
TFS:
<xsl:value-of select="td[@class=$TFS_ID]/." />
</xsl:if>
<br />
<!--TFS_Triage-->
<xsl:if test="td/@class=$Triage">
<xsl:value-of select="td[@class=$Triage]/." />
</xsl:if>
<br />
<!--V. In-->
<xsl:if test="td/@class=$V.In">
<xsl:value-of select="td[@class=$V.In]/." />
</xsl:if>
<br />
<!--TFS_Priority-->
<xsl:if test="td/@class=$Priority">
(Prio
<xsl:value-of select="td[@class=$Priority]/." />)
</xsl:if>
<br />
<!--TFS_Requirement Type-->
<xsl:if test="td/@class=$RequirementType">
<xsl:value-of select="td[@class=$RequirementType]/." />
</xsl:if>
<br />
<br />
<!--Auxiliary-->
<xsl:if test="td/@class=$Auxiliary">
<xsl:value-of select="td[@class=$Auxiliary]/." />
<br />
<!--Zeilenumbruch-->
</xsl:if>
<br />
</span>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!--No Requirement-->
<xsl:otherwise>
<span width="20%"></span>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</tr>
</table>
在HTML中,它的显示如下图所示
转换为Word格式后, BOLD (字符)无效,如下图所示
我错了什么?
答案 0 :(得分:0)
我不知道问题出在哪里。
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="FormatingProblem.css" />
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>