Latest web development tutorials

XSLT <xsl: apply-imports> element

XSLT Elements Reference Manual Complete XSLT Element Reference Manual

Definition and Usage

<Xsl: apply-imports> element can be applied from the imported stylesheet template rules.

Import stylesheet template rule priority than the main style sheet template rule to be low. If you want to use to import a style sheet in the article template rule, rather than the main stylesheet is equivalent to an article of the rules, it will use the <xsl: apply-imports> element.


grammar

<xsl:apply-imports/>

Attributes

no

Examples

Suppose we have a style sheet named "standard.xsl", which contains the rules for message templates element:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="message">
<h2><xsl:apply-templates/></h2>
</xsl:template>

</xsl:stylesheet>

Another style sheet to import "standard.xsl", and modify the message elements, as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="standard.xsl"/>

<xsl:template match="message">
<div style="border:solid blue">
<xsl:apply-imports/>
</div>
</xsl:template>

</xsl:stylesheet>

The results will put a message into the form elements:

<div style="border:solid blue"><h2>...</h2></div>


XSLT Elements Reference Manual Complete XSLT Element Reference Manual