8,906
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<div>
<xsl:for-each select="link_root/link">
<xsl:if test="@to='text'">
<a>
<xsl:attribute name="href">
<xsl:value-of select="url"></xsl:value-of></xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="title"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:value-of select="target"/>
</xsl:attribute>
<xsl:value-of select="text"/>
</a>
<xsl:text>|</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
<div>
<xsl:for-each select="link_root/link">
<xsl:if test="@to='image'">
<a>
<xsl:attribute name="href">
<xsl:value-of select="url"></xsl:value-of>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:value-of select="target"/>
</xsl:attribute>
<img border="0" width="120" height="60">
<xsl:attribute name="src">
<xsl:value-of select="text"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="title"/>
</xsl:attribute>
</img>
</a>
</xsl:if>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>