[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: "Tony Graham" <tgraham@xxxxxxxxxx>
Date: Thu, 19 Dec 2013 14:22:02 -0000 (GMT)
Re:  <xsl:apply-imports/> with select attribute
On Thu, December 19, 2013 12:35 pm, Christian Mahnke wrote:
>> 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="/".

So it sounds like you can't or don't want to modify those stylesheets.

> 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.

Are you able to start from an initial named template rather than matching
on '/' in your initial stylesheet?  If so, and if there's no template for
'/', then you can just use xsl:apply-templates.

If you were able to match on the document element instead of the document
node, you could potentially do the same.

If your source XML uses a different document element name from the
documents in the collection, then you could use a more specific match
pattern, e.g., '/name-of-source-document-element' and use
xsl:apply-templates to process the documents in the collection.

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.