亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
XSLT 基礎(chǔ)教程 XSL 語言 XSLT 簡介 XSLT 瀏覽器 XSLT - 轉(zhuǎn)換 XSLT <xsl:template> 元素 XSLT <xsl:value-of> 元素 XSLT <xsl:for-each> 元素 XSLT <xsl:sort> 元素 XSLT <xsl:if> 元素 XSLT <xsl:choose> 元素 XSLT <xsl:apply-templates> 元素 XSLT - 在客戶端 XSLT - 在服務(wù)器端 XSLT - 編輯 XML XML 編輯器 XSLT 元素參考手冊 XSLT <xsl:apply-imports> 元素 XSLT <xsl:apply-templates> 元素 XSLT <xsl:attribute> 元素 XSLT <xsl:attribute-set> 元素 XSLT <xsl:call-template> 元素 XSLT <xsl:choose> 元素 XSLT <xsl:comment> 元素 XSLT <xsl:copy> 元素 XSLT <xsl:copy-of> 元素 XSLT <xsl:decimal-format> 元素 XSLT <xsl:element> 元素 XSLT <xsl:fallback> 元素 XSLT <xsl:for-each> 元素 XSLT <xsl:if> 元素 XSLT <xsl:import> 元素 XSLT <xsl:include> 元素 XSLT <xsl:key> 元素 XSLT <xsl:message> 元素 XSLT <xsl:namespace-alias> 元素 XSLT <xsl:number> 元素 XSLT <xsl:otherwise> 元素 XSLT <xsl:output> 元素 XSLT <xsl:param> 元素 XSLT <xsl:preserve-space> 和 <xsl:strip-space> 元素 XSLT <xsl:processing-instruction> 元素 XSLT <xsl:sort> 元素 XSLT <xsl:stylesheet> 和 <xsl:transform> 元素 XSLT <xsl:template> 元素 XSLT <xsl:text> 元素 XSLT <xsl:value-of> 元素 XSLT <xsl:value-of> 元素 XSLT <xsl:variable> 元素 XSLT <xsl:when> 元素 XSLT <xsl:with-param> 元素 XSLT 函數(shù) XSLT current() 函數(shù) XSLT document() 函數(shù) XSLT element-available() 函數(shù) XSLT format-number() 函數(shù) XSLT function-available() 函數(shù) XSLT generate-id() 函數(shù) XSLT key() 函數(shù) XSLT system-property() 函數(shù) XSLT unparsed-entity-uri() 函數(shù)
characters

XSLT current() 函數(shù)



定義和用法

current() 函數(shù)返回僅包含當(dāng)前節(jié)點(diǎn)的節(jié)點(diǎn)集。通常,當(dāng)前節(jié)點(diǎn)與上下文節(jié)點(diǎn)是相同的。

<xsl:value-of select="current()"/>

等于

<xsl:value-of select="."/>

不過,有一點(diǎn)不同。讓我們看一下下面的 XPath 表達(dá)式:"catalog/cd"。表達(dá)式選擇了當(dāng)前節(jié)點(diǎn)的 <catalog> 子節(jié)點(diǎn),然后選擇了 <catalog> 節(jié)點(diǎn)的 <cd> 子節(jié)點(diǎn)。這意味著,在計算的每一步上,"." 都有不同的意義。

下面這行:

<xsl:apply-templates select="//cd[@title=current()/@ref]"/>

將處理 title 屬性的值等于當(dāng)前節(jié)點(diǎn)的 ref 屬性的值的所有 cd 元素。

與這個不同:

<xsl:apply-templates select="//cd[@title=./@ref]"/>

這個會處理 title 屬性和 ref 屬性具有相同值的所有 cd 元素。


語法

node-set current()

實例 1

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="catalog/cd/artist">
Current node: <xsl:value-of select="current()"/>
<br />
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Previous article: Next article: