<xsl:attribute name=
"target"
>_blank</xsl:attribute>
examples:
<!--?xml version=
"1.0"
encoding=
"gb2312"
?-->
<!--?xml-stylesheet type=
"text/xsl"
href=
"data.xsl"
?-->
<root>
<search>
<url>http:
<word>xml数据</word>
</search>
<search>
<url>http:
<word>xml数据</word>
</search>
<search>
<url>http:
<word>极限编程(xp)</word>
</search>
<search>
<url>http:
<word>极限编程(xp)</word>
</search>
</root>
<!--?xml version=
"1.0"
encoding=
"gb2312"
?-->
<xsl:stylesheet version=
"1.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
>
<!-- 去掉下面一句,将出现错误 -->
<xsl:output method=
"xml"
encoding=
"gb2312"
media-type=
"text/xml"
/>
<xsl:template match=
"/"
>
<xsl:apply-templates>
</xsl:apply-templates></xsl:template>
<xsl:template match=
"search"
>
<xsl:element name=
"a"
>
<xsl:attribute name=
"href"
><xsl:value-of select=
"url"
><xsl:value-of select=
"word"
></xsl:value-of></xsl:value-of></xsl:attribute>
<xsl:value-of select=
"word"
>
</xsl:value-of></xsl:element>
<br>
</xsl:template>
</xsl:stylesheet>
<!--?xml version=
"1.0"
encoding=
"gb2312"
?-->
<xsl:stylesheet version=
"1.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match=
"/"
>
<xsl:apply-templates>
</xsl:apply-templates></xsl:template>
<xsl:template match=
"search"
>
<xsl:element name=
"a"
>
<xsl:attribute name=
"href"
><xsl:value-of select=
"url"
><xsl:value-of select=
"word"
></xsl:value-of></xsl:value-of></xsl:attribute>
<!-- 去掉下面一句,将出现错误 -->
<xsl:attribute name=
"target"
>_blank</xsl:attribute>
<xsl:value-of select=
"word"
>
</xsl:value-of></xsl:element>
<br>
</xsl:template>
</xsl:stylesheet>