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 要素は、名前のないデータ型であることに注意してください。

参照

リファレンス

XML スキーマ (XSD) リファレンス
XML データ型リファレンス

概念

XSD サポートに XPath 拡張関数を使用する