This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: import/include and apply-imports
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] import/include and apply-imports
- From: Janning Vygen <vygen at planwerk6 dot de>
- Date: Thu, 10 May 2001 09:47:09 +0200
- Organization: Planwerk 6 /websolutions
- References: <000b01c0d8e6$80424bc0$a301a8c0@3d38kw1n0b1udc>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Am Donnerstag, 10. Mai 2001 02:16 schrieb Tim Watts:
> Janning
>
> As I understand it, there can be only one <template match="book"> in an
> xsl.
you can have many templates matching book if they dont have
the same import priority.
> If first.xsl has a <template match="book"> that will be used over the ones
> from the included xsl's, and otherwise if there are more than one then the
> last one is used (in Saxon - depends on the XSL Parser I think)
>
> As second.xsl is imported after third.xsl, only the template match in
> second.xsl is used.
>
> Otherwise, what would the processor do? Which should it use? It wouldn't
> make sense to have more than one template matching the same node.
First the processor should match the template in the second file because it
is not imported and has higher priority.
Then it should apply all imports. But it doesn´t. it just applies those
imports which are really in the same file. I think the imported template
should match because first and second are one logical file. Thats how i
understood include. But i guess i was wrong.
> I'm pretty sure I read about this in Michael Kays XSLT book, but he may
> clarify your question.
I would appreciate it.
Janning
> -----Original Message-----
> From: Janning Vygen
> Sent: Thursday, 10 May 2001 3:19 AM
> Subject: [xsl] import/include and apply-imports
>
> first.xsl:
> ------
> <xsl:import href="third.xsl">
> <xsl:include href="second.xsl">
>
> second.xsl
> --------
> <template match="book">
> <xsl:apply-imports/>
> </template>
>
> third.xsl
> ------
> <template match="book">
> AM I EVER EVER MATCHED?
> </template>
>
>
> the template in the third.xsl is NEVER matched!!
> Why? I thought, that include means, the stylesheet is included like it was
> always in this file??
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list