Re: AW: Copy atrribute

<denis.maier@unibe.ch> writes:
> Is there something you can do with p:add-attribute, but not with p:label-elements? Otherwise, wouldn’t it make sense to just merge the steps into one?

I’m not sure that’s an ideal criterion to use. After all, you could replace a whole lot of steps just with p:xslt by that metric.

I think the semantics of p:label-elements are a fair bit more complex than the ones for p:add-attribute. Despite many years of having both, you’re the first person I know of who had a use case for adding attributes that wasn’t satisfied by p:add-attribute.

And, semantics-wise, it’s interesting that your use case didn’t involve one of the key features of p:label-elements: the magic, and magically advancing, $p:index variable.

When I’ve got more time, I’ll try to think through what a more generic version of add-attribute/label-elements/update-this-thing might look like. My intuition is that if you want it for adding attributes, you might equally want it for adding content; a sort of dynamic p:insert or something. But maybe that’s the point where you just step up and write some XSLT. I dunno.

The step library, like the standard function library in a programming language, is a mixture of requirements and conveniences, an attempt to make it easy for users to find the thing they want, without providing so many things that it’s bewildering. Or any more bewildering,
maybe. :-)

                                        Be seeing you,
                                          norm

--
Norm Tovey-Walsh <ndw@nwalsh.com>
https://norm.tovey-walsh.com/

> Life always comes to a bad end.--Marcel Aymé

Received on Monday, 24 March 2025 14:23:09 UTC