XSLT的一个一个问题,请不吝赐教

babysloth 2002-03-14 03:27:07
请问如何用XSLT将
<text>Here is <link url="http://www.w3c.org">xml</link>.</text>
转换为HTML
Here is <a href="http://www.w3c.org">xml</a>.

不胜感激。
...全文
64 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
babysloth 2002-03-14
  • 打赏
  • 举报
回复
呵呵,初学嘛,所以……
老翔 2002-03-14
  • 打赏
  • 举报
回复
我不说了
karma 2002-03-14
  • 打赏
  • 举报
回复
you can also try attribute template, like this:

<xsl:template match="text">
<xsl:apply-templates />
</xsl:template>


<xsl:template match="link">
<a href="{@url}"><xsl:value-of select="." /></a>
</xsl:template>

platinum 2002-03-14
  • 打赏
  • 举报
回复
下次再有这样的问题问我吧……我给你打八折……
windlike 2002-03-14
  • 打赏
  • 举报
回复
分数好高,不至于吧。hehe
oliff 2002-03-14
  • 打赏
  • 举报
回复
<xsl:template match="text">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="link">
<a>
<xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute><xsl:apply-templates />
</a>
</xsl:template>
oliff 2002-03-14
  • 打赏
  • 举报
回复
<xsl:template match="text">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="link">
<a>
<xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute><xsl:apply-templates />
</a>
</xsl:template>

8,909

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧