467,888 Members | 1,392 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,888 developers. It's quick & easy.

XSLT: Conflict Resolution for Template Rules

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I am a XSLT-beginner and i read the XSLT-recommendation of the W3C through.
But I did'nt really understand section 5.5 of the latest specification. The
Problem is what template rule to be used if there are more than one
matching template rule.
You will find the following:

- ----------
....
5.5 Conflict Resolution for Template Rules
It is possible for a source node to match more than one template rule. The
template rule to be used is determined as follows:

1) First, all matching template rules that have lower import precedence than
the matching template rule or rules with the highest import precedence are
eliminated from consideration.

2) Next, all matching template rules that have lower priority than the
matching template rule or rules with the highest priority are eliminated
from consideration. ...
- ---------

Who is in the position to explain paragraph 1) and 2) to me? What is "the
matching template rule"?

Thank you in advance
Joachim Spoerhase

- -------------------------------
Joachim Spoerhase
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/FUa59GC6tHzFSj0RAp9sAJoDvx9ujcfTHUWAUVblJXxBMuHcAg Cfd/ny
31ie5Oxo2lcKDb+3kw7HF9I=
=2DjN
-----END PGP SIGNATURE-----
Jul 20 '05 #1
  • viewed: 2126
Share:
1 Reply

"Joachim Spoerhase" <ac****@west.de> wrote in message
news:bf************@ID-174644.news.uni-berlin.de...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I am a XSLT-beginner and i read the XSLT-recommendation of the W3C through. But I did'nt really understand section 5.5 of the latest specification. The Problem is what template rule to be used if there are more than one
matching template rule.
You will find the following:

- ----------
...
5.5 Conflict Resolution for Template Rules
It is possible for a source node to match more than one template rule. The
template rule to be used is determined as follows:

1) First, all matching template rules that have lower import precedence than the matching template rule or rules with the highest import precedence are
eliminated from consideration.

2) Next, all matching template rules that have lower priority than the
matching template rule or rules with the highest priority are eliminated
from consideration. ...
- ---------

Who is in the position to explain paragraph 1) and 2) to me?
1) roughly means that all matching templates that are imported before a
given matching template are eliminated from consideration.

For example, if a stylesheet contains these two instructions:

<xsl:import href="a.xsl"/>
<xsl:import href="b.xsl"/>

then if b.xsl contains a matching template then all matching templates from
a.xsl are not considered, because they have lower import precedence
(priority).

2) roughly means that from the remaining matching templates (after 1) is
applied), the ones with priority, which is less than the maximum priority
among all such matching templates, are also eliminated from consideration.

So, if in the same stylesheet we have two matching templates, one with
priority="2" and the other with priority="6", then the first one is
eliminated from consideration, because it has a lower priority specified by
the XSLT programmer.
What is "the
matching template rule"?


It is said clearly -- the one or ones with the highest priority.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Andy Dingley | last post: by
12 posts views Thread by Keith Chadwick | last post: by
2 posts views Thread by Daniel Walzenbach | last post: by
2 posts views Thread by pintihar | last post: by
7 posts views Thread by pintihar | last post: by
3 posts views Thread by super.raddish | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.