Re: Side-effects, state, internal references

Subject: Re: Side-effects, state, internal references
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: Thu, 16 Apr 1998 14:39:58 -0400
| As I want to number the productions (which are marked up inside
| a "prod" element, I thought about incrementing a global variable
| (initialised to zero inside a <define-script>...</define-script>)
| but that is explicitly forbidden by the XSL spec (section 7.2: Limited
| Side-effects). As the "prod" elements are encapsulated inside various
| "scrap" element and possible further "prodgroup" elements, I cannot 
| see how to simply get at the sequence number of the "prod"s in the
| global document by using built-in functions. 

One of the problems with the submission is that it says almost
nothing about what builtin functions exist.  With xslj, you can
use the elementNumber() function from DSSSL to enumerate the
productions.  (If I'm wrong about that, I'm sure Henry will
correct me ;-)

| where the numbers between [..] are those of the productions which
| define the terms in question. This probably needs two passes on the
| source document, but as I cannot build anything in global space, I don't

Actually, Jade builds the entire grove in memory, so two passes
are not required.

| see how I could associate elements via their attributes with information
| I generate for one of the elements (the definition of the term) in
| question.
| 
| Any help would be greatly appreciated (I use xslj 0.4 with the latest
| jade on NT to do my experiments). Thanks in advance.

There are a couple of ways to make links in xslj that will work.  One
is nodeListAddress().  I've got an example of this in the tutorial
that Paul Grosso and I gave at XML'98.  See the recipe collection
example in

   http://nwalsh.com/tutorials/xml98/xsl/

                                        Cheers,
                                          norm
-- 
Norman Walsh <nwalsh@xxxxxxxxxxxxx> | Truth lies within a little
Senior Application Analyst          | uncertain compass, but error is
ArborText, Inc. (www.arbortext.com) | immense.
413.549.3868 Voice/FAX              | 


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


Current Thread