xsl-list
[Top] [All Lists]

Re: Re: Comparing Node Text Content with a String Set

2003-10-28 11:26:54
Thanks to Wendell for answering this -- I see this message only now and do
not have anything to add to Wendell's reply.

Using global-scope elements in a user-defined namespace for defining any
necessary program-data structure is a well-known XSLT design pattern. It is
superior to and cleaner than using dummy named templates that shouldn't be
called.

There are many, many examples in this list of using this design pattern.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


"Passin, Tom" <tpassin(_at_)mitretek(_dot_)org> wrote in message
news:5D3C2276FD64424297729EB733ED1F7603B0EB49(_at_)email1(_dot_)mitretek(_dot_)org(_dot_)(_dot_)(_dot_)
[ Dimitre Novatchev]
[
You can actually also put the lookup table into a named
template in the
stylesheet.  You can access it via
document('')/xsl:stylesheet/xsl:template[name="..."], where
"..." is the
name of the template.  This way you do not need to coordinate and
maintain an extra external file.

Yes,  but if you happen to call this named template the
lookup table has
good chances to appear in the output...

It is shorter and safer to have the table as a child of the
xsl:stylesheet
element.


 If you use a named template, it should not get invoked by mistake
because it will never match anything, and you would only call it where
you want the lookup to be done.  On the other hand,  the stylesheet
element is not allowed to have arbitrary elements as direct children, so
that route won't work.

Cheers,

Tom P

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list






 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list