[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: <xsl:apply-imports/> with select attribute

Subject: Re: <xsl:apply-imports/> with select attribute
From: Christian Mahnke <cmahnke.sub@xxxxxxxxxxxxxx>
Date: Thu, 19 Dec 2013 13:35:15 +0100
Re:  <xsl:apply-imports/> with select attribute
Hi Micheal,
>
> What would you want this construct to actually do?

My use case is as follows: Ive got a master template, in which the template
@match="/" contains a <xsl:for-each/> over a collection(). Inside the loop I
would like to call templates from imported stylesheets, that are designed to
handle single documents. Additionally they havent be designed to run together
with other templates, so they contain no @mode attribute on their template
@match="/".

This way the calls to <xsl:apply-templates select="./> (where . is a document
node from the collection) doesnt match the root template of the imported
stylesheet, but the root template of the master stylesheet, which causes a
unwanted loop.

Im just looking for a way to be able to give the imported stylesheets a
higher priority when Im looping to a collection of files.

Best,
Christian

> apply-imports means "process the current node using the template that would
have matched if this one didn't". It's hard to see what that could mean when
processing a different node, i.e. one that doesn't necessarily match the
current template rule.
>
> Michael Kay
> Saxonica
>
> On 19 Dec 2013, at 11:07, Christian Mahnke <cmahnke.sub@xxxxxxxxxxxxxx>
wrote:
>
>> Hi list,
>> is there a way (in XSLT 2.0) to get a mix of <xsl:apply-templates
select="document($file)/> and <xsl:apply-imports/>? Something like
<xsl:apply-imports select="document($file)/>
>> This doesnt seem to be valid but would be very useful
>>
>>
>> Best,
>> Christian

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.