Yuan Yijun (bbbush) wrote,
Yuan Yijun
bbbush

看到 xslt 的一段文章

http://www.xml.com/pub/a/2003/11/05/xslt.html

感兴趣的是复制属性,今天才知道 xsl:copy 和 xsl:copy-of select="@*" 可以结合起来用。

这样
	<xsl:template match="*">
		<xsl:copy>
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="*" mode="default">
		<xsl:copy>
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>


几乎完全一样的模版
Tags: 工作
Subscribe

  • My tweets

    Wed, 09:34: WIthout threading support, Outlook managed to introduce "Focused" and "Other" as tabs in the inbox. Now I got two inbox to check.

  • My tweets

    Tue, 11:06: With IntelliJ IDEA it is really hard to tell which window is "active" by looking at the taskbar icon. The project n……

  • My tweets

    Sun, 21:01: Scared a little bit https://t.co/MQI4IPzfDa Sun, 22:07: https://t.co/22J8hD4xrp ugly paradise

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments