현재 노드에 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]) 함수 항목에 표시된 것과 같습니다.
XSLT 파일(books.xslt)
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="text()"/>
<xsl:output method="html"
omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*">
<!-- process only those element whose schema-info is available. -->
<xsl:if test="ms:schema-info-available()">
<DIV>
<xsl:value-of select="name()"/> is of
"<xsl:value-of select="ms:type-local-name()"/>" in
"<xsl:value-of select="ms:type-namespace-uri()"/>"
</DIV>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
출력
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
항목에 표시된 것과 같습니다.