|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
xsl:import versus xsl:include?
xsl:import and xsl:include both deal with outside stylesheets, and the syntax looks the same. So what is the practical difference between the two?
__________________
Hello, old friend... |
|
#2
|
||||
|
||||
|
In regards to template that match the same criteria or have the same name:
An included style sheet has the same precedence as the including style sheet. An imported style sheet has lower precedence than the importing style sheet. I have something at work that explains it better. I will write that up for you tomorrow since I can't find a good explanation online. |
|
#3
|
|||
|
|||
|
If you want to see the nitty gritty, the following is an
explanation of how xsl:import and xsl:include are implemented in the xalan processor http://xml.apache.org/xalan-j/xsltc...ude_design.html |
|
#4
|
||||
|
||||
|
If you import a stylesheet, and have overridden a template in the imported stylesheet, it allows you to take advantage of apply-imports.
Example: Starter.xsl Code:
<xsl:stylesheet>
<xsl:template match="salary"> ...
</xsl:stylesheet>
Code:
<xsl:stylesheet>
<xsl:template match="salary">
<b><xsl:apply-imports/></b>
</xsl:template>
</xsl:stylesheet>
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > xsl:import versus xsl:include? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|