ms:type-local-name([node-set]) 函数
返回当前节点或所提供节点集中的第一个节点(按文档顺序)的 XSD 类型的非限定名称。
string ms:type-local-name([node-set])
备注
对于简单类型,type-local-name
函数返回“ID”或“ENTITY”等名称。 对于指定了 name
属性的复杂 XSD 类型,type-local-name
返回“Class”等非限定名称。 无名称类型使函数返回空字符串。
以下示例表达式选择所有包含 XSD 内置基元数据类型“string”的节点。
"//*[ms:type-local-name()='string')]"
示例
以下示例使用 XSLT 模板规则,从 books.xml 中选择所有元素并输出元素的数据类型(按 books.xsd 中的定义)。
XML 文件 (books.xml)
使用 books.xml。
XSD 文件 (books.xsd)
使用 books.xsd。
XSLT 文件 (books.xslt)
HTML 文件 (books.html)
HTML 文件包含处理加载 XML、XSLT 和 XSD 文件过程的 JScript。
输出
x:catalog is of
book is of
author is of string
Gambardella, Matthew
title is of string
XML Developer's Guide
genre is of string
Computer
price is of float
44.95
publish_date is of date
2000-10-01
description is of string
An in-depth look at creating applications with XML.
请注意,x:catalog
和 book
元素具有无名称类型。