Subject: Re: [xsl] Rexsel — A simpler way of writing XSLT — thinking in trees From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 1 Jul 2024 19:16:40 -0000 |
> For those of us who _like_ XML, at least overall, or who work routinely > with complex documents, or both :), XSLT is a small step and a very > welcome one. But we have to remember that this is not universal, > strange as it sometimes seems! Definitely! In fact, tree-processing can be done with a fold function, defined on a tree (data type). This was shown even in the 90-ies - see for example "Why Functional Programming Matters: by John Hughes: https://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf. There, on page 7 he defines and provides the implementation of a function named `foldtree`. And this was implemented also in the FXSL library - almost 20 years ago. See for example: - https://fxsl.sourceforge.net/articles/FuncProg/3.html#Tree_processing - https://sourceforge.net/projects/fxsl/files/FXSL%20for%20XSLT%202/FXSL%202 .0/ This was meant when I proposed a solution to Roger's problem of including logging output alongside the ordinary output of XSLT processing. When expressing the tree-processing as a fold operation on a tree, then the accumulator of fold-tree can have two different components, that are set again and again on every step of the folding. One component can be the "regular output". The 2nd component can be the concatenation of all log-outputs so far. Or it can be a map, to which a new log-entry is added (map:put) to replace the map from the old step. Thanks, Dimitre On Sun, Jun 30, 2024 at 5:45b/PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > On Sun, 2024-06-30 at 22:19 +0000, Graydon graydon@xxxxxxxxx wrote: > > On Sun, Jun 30, 2024 at 10:06:01PM -0000, Liam R. E. Quin > > liam@xxxxxxxxxxxxxxxx scripsit: > > > A companion question is also interesting though - an > > > XSLT that is useful for, and appeals to, curly-brace-programming > > > people? [...] > > > > [...] the degree to which the syntax is the problem is always > > small; the actual problem is thinking in trees, > > Years ago LISP people used to say, the syntax isnbt important; the hard > part is thinking in lists. It wasnbt true then, either :-) > > Yes, thinking in trees can be hard, but in order for people to > experience this they have to get past the syntax. > > Or to quote from the Mahabarata, > `$*`%`$0`%`$7 `$*`%`$0`%`$7`%`$ `$`% `$`%`$2`$>`$. `$,`$(`$>`$`$0 `$0`$`$$`% `$9`%`$ `$`$0 `$ `$(`% `$9`%`$ `$*`%`$`$`$0, `$,`$>`$`$'`$`$0 `$`$0 `$`$(`% `$/ > `$*`% `$0`$`$>`$0 `$8`% `$,`$`$'`$(`%`$ `$.`%`$ `$,`$>`$`$'`$`$0 `$&`$?`$(-`$0`$>`$$ `$ `$(`$8`% `$`$>`$. `$`$0`$5`$>`$$`% `$9`%`$`%$ `$/`% `$2`%`$ `$*`$?`$`$>`$ > `$`$0 `$`$`$`%`$0`%`$ `$.`%`$ `$`$`$!`$<`$(`% `$8`% `$9`%`$(`% `$5`$>`$2`% `$&`$0`% `$& `$8`% `$`$(`$-`$?`$`% `$ `$(`$9`%`$ `$9`%`$`%$ > > (and the different writing system is just surface syntax, right?) > > So i have a lot of sympathy for people who, not being forced to learn > XSLT, choose not to, because the syntax is unfamiliar and they donbt > perceive major benefits to them. > > For those of us who _like_ XML, at least overall, or who work routinely > with complex documents, or both :), XSLT is a small step and a very > welcome one. But we have to remember that this is not universal, > strange as it sometimes seems! > > liam > > -- > Liam Quin, https://www.delightfulcomputing.com/ > Available for XML/Document/Information Architecture/XSLT/ > XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. > Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] XSL-List Guidelines, B Tommie Usdin btusd | Thread | [xsl] targeting the 'first' instanc, Jean-Paul Rehr rehrj |
Re: Re: [xsl] Rexsel - A simpler wa, list.mu@xxxxxxxxxxx | Date | Re: [xsl] xslide [Was: Rexsel — A , Peter Flynn peter@xx |
Month |