xsl:import
xsl:include
xsl:template
ELEMENT: xsl:apply-imports
<xsl:apply-imports>
</xsl:apply-imports>
The
xsl:apply-imports
element is used to apply (invoke) the definitions and template rules of an imported stylesheet that normally might be overridden by the importing stylesheet.
When one or more stylesheets are imported using the
xsl:import
element, the imported stylesheets are assigned a lower import precedence than the importing stylesheet. This means that the definitions and rules contained in the imports may be overridden and therefore may not be applied. The purpose of the
xsl:apply-imports
element is to permit these overridden rules to be applied when and where you desire them to be applied.
This element has no attributes. It is not a self-closing tag. The separate closing element is mandatory.
We use the
DevGuru Staff List XML file
for our example with the following header:
<?xml-stylesheet type="text/xsl" href="xslt_example_applyimports.xsl"?>
and we name it: xslt_example_applyimports.xml
We import and apply:
xslt_example_choose.xsl
(will appear in separate window - use "view source" to see code)
Code for xslt_example_applyimports.xsl:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="xslt_example_choose.xsl" />
<xsl:template match="/">
<html>
<body>
<
xsl:apply-imports /
>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Output:
Click to view output in separate window
- requires Internet Explorer
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information