ms:schema-info-available 関数

現在のノードの XSD 情報があれば、true を返します。

        boolean ms:schema-info-available()

解説

次の式は、XSD 型情報を持つすべてのノードに対して true を返します。

"//*[ms:schema-info-available()]"

次の例では、XSLT テンプレート規則を使用して books.xml のすべての要素を選択し、その要素のデータ型と、books.xsd で定義されている名前空間 URI を出力します。

XML ファイル (books.xml)

books.xml を使用します。

XSD ファイル (books.xsd)

books.xsd を使用します。

HTML ファイル (books.html)

この HTML ファイルは、「ms:type-namespace-uri([node-set]) 関数」に示されている HTML ファイルと同じです。

XSLT ファイル (books.xslt)

出力

x:catalog is of "" in ""

book is of "" in ""

author is of "string" in "http://www.w3.org/2001/XMLSchema"

title is of "string" in "http://www.w3.org/2001/XMLSchema"

genre is of "string" in "http://www.w3.org/2001/XMLSchema"

price is of "float" in "http://www.w3.org/2001/XMLSchema"

publish_date is of "date" in "http://www.w3.org/2001/XMLSchema"

description is of "string" in "http://www.w3.org/2001/XMLSchema"

description is of "string" in "http://www.w3.org/2001/XMLSchema"

この出力では、スキーマ情報がすべての要素について提供されているため、ms:type-namespace-uri に関するトピックで示されているものと同一になります。

参照

リファレンス

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

概念

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