AW: Copy atrribute

Ha, that's cool, but I also think it would certainly qualify as step abuse. Would it make sense to add something like this to p:add-attribute? (Sure, I know I can also use a custom step to hide the implementation, but anyway.)

Best,
Denis

> -----Ursprüngliche Nachricht-----
> Von: Norm Tovey-Walsh <ndw@nwalsh.com>
> Gesendet: Freitag, 21. März 2025 09:43
> An: Wendell Piez <wapiez@wendellpiez.com>
> Cc: Maier, Denis Christian (UB) <denis.maier@unibe.ch>; xproc-dev@w3.org
> Betreff: Re: Copy atrribute
> 
> Wendell Piez <wapiez@wendellpiez.com> writes:
> > 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.
> 
> Indeed. I thought about that for 30 seconds and persuaded myself that it
> couldn't be made to work for this example. Your observation persuaded me to
> think a little longer. It feels a little like "step abuse", but this works:
> 
>   <p:identity>
>     <p:with-input>
>       <doc>
>         <a data-custom-style="spoon"/>
>         <b data-custom-style="fork"/>
>       </doc>
>     </p:with-input>
>   </p:identity>
> 
>   <p:label-elements match="*[@data-custom-style]"
>                     attribute="class"
>                     label="@data-custom-style"/>
> 
> producing
> 
> <doc>
>    <a data-custom-style="spoon" class="spoon"/>
>    <b data-custom-style="fork" class="fork"/> </doc>
> 
>                                         Be seeing you,
>                                           norm
> 
> --
> Norm Tovey-Walsh <ndw@nwalsh.com>
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnorm
> .tovey-
> walsh.com%2F&data=05%7C02%7Cdenis.maier%40unibe.ch%7C55c1de727
> d21482c1fc408dd685456f3%7Cd400387a212f43eaac7f77aa12d7977e%7C
> 1%7C0%7C638781433647716174%7CUnknown%7CTWFpbGZsb3d8eyJFbX
> B0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWF
> pbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=uE5beZZdgSUrWWuYWd
> E5LBgLEQefmRXMDgV8ag4nIX0%3D&reserved=0
> 
> > A jester unemployed is nobody's fool.--Danny Kaye

Received on Friday, 21 March 2025 09:13:05 UTC