xsl-list
[Top] [All Lists]

Re: Naming styles

2004-08-20 08:12:47
Indeed i'm using only includes, not imports. However, i thought that the two are
basicaly the same, the only diference being their precedence, concept that i
don't understand completly.

I even thought that they are interchangeble without problems in most of the
cases (altought that make me wonder why there are two elements to do the same
thing...)

So if i understand correctly, if i have several equal definitions of vars or
templates in several xsl, using import only one of the definitions is "valid"
while if i use include that will lead to conflict problems?

Regards.


Quoting David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk>:


I have several imports, like this


actually you showed xsl:include for which the "best practices" need to
be slightly different than for xsl:import.

If I'm using xsl:import (which I do, mostly) I usually try to make sure
that any variables are defined in each stylesheet, either by having an
explicit xsl:variable... or xsl:importing some stylesheet that defines
the variable.


when pulling together a complete stylesheet by importing all the
components, the import precedence rules will mean that all but one of
the variable definitions will be ignored so you just have to make sure
that the one you want is the one with highest precedence.

If you use xsl:include however, multiple definitions of the same variable
would lead to redfinition errors and so there you need to make sure that
your component stylesheets _don_t (re)define the variables.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--









O SAPO já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt


<Prev in Thread] Current Thread [Next in Thread>