Re: [xsl] How do you avoid relearning the same coding technique over and over?

Subject: Re: [xsl] How do you avoid relearning the same coding technique over and over?
From: "Bridger Dyson-Smith bdysonsmith@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 6 Feb 2025 18:27:52 -0000
Hi Roger,

It's a real problem, isn't it? My solution has been to keep version
controlled directories of self-contained executable examples for all of my
XSLT, XQuery, XProc, etc etc studies and efforts. Easily transferred
between machines, easily navigable with either command line tools, file
browsers, or a web browser, and easy to revisit when the need arises.

I hope that's helpful!
Best,
Bridger

On Thu, Feb 6, 2025, 1:16b/PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> On Thu, 2025-02-06 at 12:19 +0000, Roger L Costello costello@xxxxxxxxx
> wrote:
> >
> > What's the solution? Discipline? No matter how much I'm in a hurry,
> > stop and create an example. Is that the solution?
>
> Well,
>
> locate .xsl | grep $HOME | xargs grel -l expath
>
> will go a long way for me (Linux). Or,
> find . -name "*.xsl*" -print0 | xargs -0 grep -l expath
> if there might be spaces in filenames.
>
> Often, though, i remember a particular occasion, a particular
> transformation. If not, i go looking at the spec. If i canbt puzzle it
> out from the spec i go looking for examples.
>
> Asking an unreliable source such as chatgpt can be worse than a waste
> of time, as it might plant ideas that lead to wrong underlying
> assumptions that can be difficult to work past.
>
> As Wendell out-pointed, you have to think about the bigger picture. An
> example will just show you how to do one thing but not tell you the
> best approach.
>
> For example, if youbre using saxon, you can use collection() or uri-
> collection() with try/catch to run XSLT over every file in a directory,
> optionally recursively descending into subdirs (nested folders), and
> not falling over if therebs malformed XML in there. In that case you
> can use the doc() function.
>
> Debbie Lapeyre and i once watched the late Michael Sperberg-McQueen
> writing in a notepad. Asked what he was doing, he said he was working
> on a list of things to think about.
>
> Problem solving is a case of working out the right questions to think
> about.
>
> 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