XSLT: Conflict Resolution for Template Rules

Discussion in 'XML' started by Joachim Spoerhase, Jul 16, 2003.

  1. -----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/FUa59GC6tHzFSj0RAp9sAJoDvx9ujcfTHUWAUVblJXxBMuHcAgCfd/ny
    31ie5Oxo2lcKDb+3kw7HF9I=
    =2DjN
    -----END PGP SIGNATURE-----
    Joachim Spoerhase, Jul 16, 2003
    #1
    1. Advertising

  2. Re: Conflict Resolution for Template Rules

    "Joachim Spoerhase" <> wrote in message
    news:bf3gro$ab8nc$-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
    Dimitre Novatchev, Jul 16, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew FPGA
    Replies:
    0
    Views:
    969
    Andrew FPGA
    Sep 26, 2005
  2. charles cashion

    css conflict (or html conflict)

    charles cashion, Feb 18, 2009, in forum: HTML
    Replies:
    2
    Views:
    787
    charles cashion
    Feb 18, 2009
  3. Alessandro [AkiRoss] Re
    Replies:
    3
    Views:
    439
    Michael Doubez
    May 13, 2009
  4. rocky
    Replies:
    2
    Views:
    319
    rocky
    Jul 7, 2009
  5. Dema
    Replies:
    3
    Views:
    140
    Gennady Bystritksy
    Jul 12, 2005
Loading...

Share This Page