共用方式為


name 函式

傳回一個含有 QName 的字串,其代表節點集引數中位居文件順序首位之節點的展開名稱。

          string name(node-set?)

備註

QName 必須根據節點中的生效命名空間來表示展開名稱。如果節點上生效的命名空間宣告,將多個前置詞與相同的命名空間產生關聯,則不需要執行上述動作。如果節點集引數是空的,或第一個節點沒有展開名稱,則傳回空字串。如果忽略引數,則會將其預設為節點集,而唯一成員為內容節點。

範例

XML 檔 (bcat.xml)

XSLT 檔 (sample.xsl)

輔助 XSLT 檔 (book-schema.xml)

格式化輸出

name() Function

b:catalog =

b:book =

b:author = Gambardella, Matthew

b:title = XML Developer's Guide

b:genre = Computer

b:price = 44.95

b:publish_date = 2000-10-01

b:description = An in-depth look at creating applications with XML.

b:book =

b:author = Ralls, Kim

b:title = Midnight Rain

b:genre = Fantasy

b:price = 5.95

b:publish_date = 2000-12-16

b:description = A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.

處理器輸出

<html>

<body>

<h3>name() Function</h3>b:catalog = <br>b:book = <br>b:author = Gambardella, Matthew<br>b:title = XML Developer's Guide<br>b:genre = Computer<br>b:price = 44.95<br>b:publish_date = 2000-10-01<br>b:description = An in-depth look at creating applications with XML.<br>b:book = <br>b:author = Ralls, Kim<br>b:title = Midnight Rain<br>b:genre = Fantasy<br>b:price = 5.95<br>b:publish_date = 2000-12-16<br>b:description = A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.<br></body>

</html>

另請參閱

參考

XML 資料型別參考