正 文

针对不可访问 Web 页的文本选择


www.7dspace.com  更新日期:2005-10-4 12:28:45  七度空间


如果用户已经选择了格式化的视图,就会应用示例 5 中提供的 XSLT 代码。

代码示例 5. XSLT 格式化代码

<xsl:template match="table | TABLE | Table">
   <table>
      <xsl:copy-of select="@*" />
      <xsl:apply-templates />
   </table>
</xsl:template>
<xsl:template match="tr | TR">
   <tr>
      <xsl:copy-of select="@*" />
      <xsl:apply-templates />
   </tr>
</xsl:template>
<xsl:template match="th | TH">
   <th>
      <xsl:copy-of select="@*" />
      <xsl:apply-templates />
   </th>
</xsl:template>
<xsl:template match="td | TD">
   <td>
      <xsl:copy-of select="@*" />
      <xsl:apply-templates />
   </td>
</xsl:template>
<xsl:template match="img | IMG | Img">
   <img>
      <xsl:copy-of select="@*" />
      <xsl:apply-templates />
   </img>
</xsl:template>

在这种情况下,转换产生示例 6 中提供的 HTML。

代码示例 6. 得到的格式化显示

<table border="5" cellpadding="5" cellspacing="5" bordercolor="#ffffff"
bgcolor="#ff9900" width="75">

<tr><td width="70"><img border="0" src="/enable/images/photos/man.jpg"
width="70" height="70" alt="Man with laptop"></td></tr>

<tr><td width="70"><img src="images/photos/hand.jpg" width="70"
height="70" border="0" alt="Hand on keyboard"></td></tr>

<tr><td width="70" align="middle"><img
src="images/photos/braille_fingers.gif" width="65" height="91"
valign="absmiddle" alt="Fingers feeling Braille text"
border="0"></td></tr>
</table>

5页,页码:[1] [2] [3] [4] [5] 

上一篇:SQL Server 本机 Web 服务的使用方案
下一篇:ASP.NET Starter Kit 入门指南
作者:  来源:MSDN ( 责任编辑:7dspace )
收藏此页】【打印】【关闭
站 内 搜 索
 

热 点 导 读
特 别 推 荐