Re: Copy atrribute

Hello,

On occasion I confess I have used p:label-element to get around this -- it
accepts an XPath to be evaluated, not just a string.

Regards, Wendell


On Thu, Mar 20, 2025 at 12:10 PM Norm Tovey-Walsh <ndw@nwalsh.com> wrote:

> <denis.maier@unibe.ch> writes:
> > I need to copy the value of an attribute to another attribute. Should be
> easy, but no success so far. This here won’t work:
> >
> > <p:add-attribute match="*[@data-custom-style]" attribute-name="class">
> >             <p:with-option name="attribute-value"
> > select="'@data-custom-style'"></p:with-option>
> >         </p:add-attribute>
>
> No, that’s not really how the add-attribute step works. No matter what you
> do to initialize the attribute-value option, it’s going to get that value
> at the beginning of the step; it’s not going to get recalculated for each
> match.
>
> It’s interesting that this has never come up before. I wonder how many
> other steps with “match” attributes have use cases where this would be
> useful behavior.
>
>                                         Be seeing you,
>                                           norm
>
> --
> Norm Tovey-Walsh <ndw@nwalsh.com>
> https://norm.tovey-walsh.com/
>
> > The art of being wise is the art of knowing what to overlook.--William
> > James
>
>

-- 
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez... ...gitlab.coko.foundation/wendell...

Received on Thursday, 20 March 2025 18:23:10 UTC