Subject: RE: Best way to handle multiple string replacements? From: "Paulo Gaspar" <paulo.gaspar@xxxxxxxxxxxx> Date: Wed, 7 Jun 2000 14:54:15 +0200 |
My choice would still be to make those replacements with something else. When all you have is an hammer everything looks like a nail. But are you sure you HAVE to do that in with XSLT??? I am sure I could implement something faster in C, Pascal, Perl, Basic, Java... ok, I wouldn't go into assembler, but maybe even that would be easier to code and maintain than those strange things you are coding! Anyway, it was a great mind exercise and I loved it. (Yes... I also made some exercise trying to understanding it all...) Have fun, Paulo (paulo.gaspar@xxxxxxxxxxxx) > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Sebastian Rahtz > Sent: Tuesday, June 06, 2000 22:06 > To: Jeni.Tennison@xxxxxxxxxxxxxxxx > Cc: xsl-list@xxxxxxxxxxxxxxxx > Subject: Re: Best way to handle multiple string replacements? > > > Jeni Tennison writes: > > My first objection was that I thought it would be relatively > inefficient if > > you have a long piece of text and not very many substitutions > to be made > > within it. I could well be wrong on that (I'm no computer > scientist) - out > > of interest, did you compare the performance of the two stylesheets? > > No, I am afraid I did not. I quite take the point, though. I was more > concerned with (my notion of!) elegance, than performance. > > Lets face it, all these approaches are messy, like dogs walking on hind > legs. This isn't what XSL is good at... > > > My second objection was that it would get a bit more > complicated when you > > had substitutions of things that were of arbitrary length (i.e. strings > > rather than single characters). > > I can imagine using "starts-with()" on each fresh chunk of text, but I > have not though that through > > > True, although the order of events would also be crucial (and implicit) > > within your method in the case where more than one character was being > > replaced. > > I think I was describing a solution to a traditional transcoding > problem, which was what Warren *seemed* to have; you described a > solution to a fairly spare replacment, which may well be what he does > have. > > > I would be interested to see the results of > > the performance comparison, if you do it. > > Sorry, I have to write an article for my daughters primary school > newsletter > tonight, about the family links programme. amazingly, it uses no XSL > at all > > Sebastian > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Best way to handle multiple str, Sebastian Rahtz | Thread | Re: Best way to handle multiple str, Warren Hedley |
RE: dealing with CDATA (was dealing, Paulo Gaspar | Date | RE: How to transform flat structure, Paulo Gaspar |
Month |