Associating XSLT with XML

Make use of processing instructions to associate a XSLT stylesheet with XML.

<?xml-stylesheet type="text/xsl" href="document.xsl"?>
<document>
  ...
</document>
			
  • Use 'xml-stylesheet' to identify that this is a processing-instruction directed at stylesheet languages.

  • Use 'type="text/xsl"' to distinguish from other stylesheet languages.

  • Use 'href="document.xsl"' to identify the xslt stylesheet location.

  • Most browsers will follow this processing instruction.