Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Home » Tip Bank » XML » XSLT
Language: XML
Expertise: Advanced
Jun 5, 2007



Application Security Testing: An Integral Part of DevOps

Import an XML Schema into a Stylesheet Using XSLT 2.0

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:

      <xs:simpleType name="year_maxim">		 	 	
         <xs:restriction base="xs:positiveInteger">
            <xs:minExclusive value="1990" />
            <xs:maxExclusive value="2010" />
Leonard Anghel
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date