ms:schema-info-available Function

Returns true if XSD information is available for the current node.

          boolean ms:schema-info-available()

The following expression returns true for all nodes with XSD-type information.


The following example uses an XSLT template rule to select all the elements in books.xml, and to output the elements' data types and the namespace URI as defined in books.xsd.

XML File (books.xml)

Use books.xml.

XSD File (books.xsd)

Use books.xsd.

HTML File (books.html)

The HTML file is the same as that listed in the ms:type-namespace-uri([node-set]) Function topic.

XSLT File (books.xslt)

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" 
  <xsl:template match="text()"/>
  <xsl:output method="html"   

  <xsl:template match="/">

  <xsl:template match="*">
    <!-- process only those element whose schema-info is available. -->
    <xsl:if test="ms:schema-info-available()">
          <xsl:value-of select="name()"/> is of
          "<xsl:value-of select="ms:type-local-name()"/>" in
          "<xsl:value-of select="ms:type-namespace-uri()"/>"



x:catalog is of "" in ""

book is of "" in ""

author is of "string" in ""

title is of "string" in ""

genre is of "string" in ""

price is of "float" in ""

publish_date is of "date" in ""

description is of "string" in ""

description is of "string" in ""

The output here is the same as that shown in the ms:type-namespace-uri topic, because the schema information is available for every element.

Build Date: