This tip shows you how to import an XML schema in your XSL pages, using XSLT 2.0. For example, if your XML schema is named
schema.xsd and it is stored in the same directory with your stylesheet, then you can import it like this:
<xsl:import-schema schema-location="schema.xsd"/>
If you want, you can define "rules" directly into the stylesheets by using the
xs:schema element. In this case, you must skip the schema-location attribute. For example:
<xsl:import-schema>
<xs:schema>
<xs:simpleType name="year_maxim">
<xs:restriction base="xs:positiveInteger">
<xs:minExclusive value="1990" />
<xs:maxExclusive value="2010" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
</xsl:import-schema>