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

Re: Error template trumping other templates on import?

Subject: Re: Error template trumping other templates on import?
From: Tony Graham <Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Aug 2007 21:18:04 +0100
Re:  Error template trumping other templates on import?
On Mon, Aug 27 2007 20:21:49 +0100, subsume@xxxxxxxxx wrote:
> I've got master.xsl which is imported by local.xsl. local.xsl also
> includes global.xsl. global.xsl, which contains an error-matching
> template in order to alert me in the case of ambiguous/non-matches. I
> know several of you use a similar template to catch template match
> problems.
>
> My problem is that when included into local.xsl, the error template
> takes over all matches. However, when the templates from master.xsl
> are placed into local.xsl, all is fine. Also, when the error template
> is removed entirely, everything matches as expected.
>
> Is the error matching template causing all templates in master.xsl not
> to be imported?

Import "global.xsl" then import "master.xsl".

Currently, the imported templates in 'master.xsl" have a lower "import
precedence" [1] than the templates in 'local.xsl', and the templates in
'global.xsl' have the higher precedence because they are effectively [2]
part of 'local.xsl'.

Of the templates that you show, the match on "node()" has the same
priority [3] as the match on "*", so when you put the templates in
'master.xsl' into 'local.xsl', it probably only works because the match
on "node()" is effectively later in the stlesheet.

Regards,


Tony Graham.
======================================================================
Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
----------------------------------------------------------------------
Menteith Consulting -- Understanding how markup works
======================================================================

[1] http://www.w3.org/TR/xslt#import
[2] http://www.w3.org/TR/xslt#include
[3] http://www.w3.org/TR/xslt#conflict

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.