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

Re: Strict sequential identity rule?

Subject: Re: Strict sequential identity rule?
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 22 Sep 2005 09:14:09 +0100
identity resolution
Evan,

Can your reporting system tell when one template has been chosen oven
another purely on import precendence, even though it has a higher
priority?

For example:

<xsl:import href="one.xsl"/>
<xsl:import href="two.xsl"/>

one.xsl contains:
<xsl:template match="elem" priority="10">

two.xsl contains:
<xsl:template match="elem">

The "elem" matching template in two.xsl will always be chosen over any
"elem" matching template in any stylesheet that is imported before it,
regardless of priority.  This currently all happens silently and can
be a nightmare to discover.

I would've hoped for the usual "ambiguous rule match", but that
happens later in conflict resolution.  The very first conflict
resolution rule is:

"1. First, only the matching template rule or rules with the highest
import precedence are considered. Other matching template rules with
lower precedence are eliminated from consideration."

So that means the "elem" matching template with priority 10 in one.xsl
is disregarded purely because one.xsl is imported before two.xsl.  I
would've expected the ordering of items in the stylesheet the be the
very last technique for conflict resolution, just like it is for
templates.

However it's not, but it would be really helpful to offer a warning
such as "A template with a higher priority conflicts with a template
with a higher import precendence" for when that happens, and then
usual ambiguous rule match for when the templates are equal priority.

I've mentioned this a few times before and it did touch on the idea of
the ability to make templates "final" (in java terms) to ensure anyone
importing your stylesheet module can't easily break it.  You certainly
can't give it a massive priority, as the real priority is decided by
whoever orders the import statements...

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.