RE: [xsl] using substring-functions more than once in a node

Subject: RE: [xsl] using substring-functions more than once in a node
From: "McNally, David" <David.McNally@xxxxxxxxxx>
Date: Thu, 28 Mar 2002 17:54:17 -0500
> Now I ve got an additional problem to solve. I am now trying 
> to markup footnotes with more than just one format, firstly 
> the (FN 1-9) Footnotes and secondly footnotes that look like 
> this *) where the *symbol can repeat up to nine times: *********)
> One way to solve this is to process the stylesheet more than 
> once supplying another $replace parameter each time 
> processing. E.g. in saxon: saxon source.xml replace.xsl replace=*****)

I'm not sure that would work, since the named template is assuming that the
search string is followed by a single digit number which is the footnote
number.  That's not the case, as far as I can tell, with these asterisks.  I
suppose you could change it to figure out if $replace has asterisks in it or
not, and define the footnote number accordingly - you'd also need to change
the definition of $after.

> This is a procedure I would like to avoid. So does anyone 
> know how I can use this named template more than once 
> replacing each time another string?

You can redefine the named template to take two params - one the input
string, the other the text to search for.  Then you can run the template
multiple times with different search strings.  You probably need a different
template for the asterisks, though - and you would have to call it
recursively with each of the different asterisk strings - which seems pretty
horrible.

You may now be reaching the point where, as Wendell suggested, a first pass
with perl or sed or something would be much simpler.

David.
--
David McNally            Moody's Investors Service
Software Engineer        99 Church St, NY NY 10007 
David.McNally@xxxxxxxxxx            (212) 553-7475 


---------------------------------------

The information contained in this e-mail message, and any attachment thereto, is confidential and may not be disclosed without our express permission.  If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited.  If you have received this message in error, please immediately notify us by telephone, fax or e-mail and delete the message and all of its attachments.  Thank you.

Every effort is made to keep our network free from viruses.  You should, however, review this e-mail message, as well as any attachment thereto, for viruses.  We take no responsibility and have no liability for any computer virus which may be transferred via this e-mail message.


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


Current Thread