FW: AW: p.wrap and attributes

Once again I fail to reply-all! This was intended for Denis -

Regards, Wendell

-----Original Message-----
From: Piez, Wendell A. (Fed) 
Sent: Monday, January 13, 2025 10:58 AM
To: denis.maier@unibe.ch
Subject: RE: AW: p.wrap and attributes

Denis,

Here is a local step declaration in a pipeline, which is then used several times. It has only p:identity but it could easily be a call to your XSLT, or a sequence of XProc steps instead or along with p:xslt.

Placing after the prologue (ports and options) and before the first step:

<p:declare-step name="report-status" type="ox:report-status">
      <p:input port="source"/>
      <p:output port="result"/>
      <p:identity message="[CONTENT-TYPE_worksheet] [STATUS REPORT] SEEING '{ p:document-property(.,'content-type') }' AT { p:document-property(.,'base-uri') }"/>
   </p:declare-step>

To invoke the step:

<ox:report-status/>

(using your own namespace)

https://github.com/wendellpiez/oscal-xproc3/blob/2aea7c67a9196f35e1b5a233c91764c6deb0ce47/tutorial/worksheets/CONTENT-TYPE_worksheet.xpl#L43

This has only p:identity (to produce a message). In your example you could call p:xslt, or do something different or in addition.

The example or something like it should be in the public oscal-xproc3 repo in due course. (And I am noting that we need tutorial treatment of how to go about declaring your own steps.)

Cheers, Wendell

-----Original Message-----
From: denis.maier@unibe.ch <denis.maier@unibe.ch>
Sent: Monday, January 13, 2025 6:59 AM
To: Piez, Wendell A. (Fed) <wendell.piez@nist.gov>
Subject: AW: AW: p.wrap and attributes

Yes, I guess that might be a good approach, but I fear I'm not yet experienced enough to understand how that would work.

Best,
Denis

> -----Ursprüngliche Nachricht-----
> Von: Piez, Wendell A. (Fed) <wendell.piez@nist.gov>
> Gesendet: Freitag, 10. Januar 2025 16:38
> An: XProc Dev <xproc-dev@w3.org>
> Betreff: FW: AW: p.wrap and attributes
> 
> Hello,
> 
> Just restating the obvious here, but we can also make our own 
> libraries for things we wish to handle 'declaratively' ... a grouping 
> or wrapping operation, for example.
> 
> If it is sufficiently generalized, your 'standard' is then already 
> half baked (or at least proofing under a towel in a warm place).
> 
> Cheers, Wendell
> 
> -----Original Message-----
> From: Norm Tovey-Walsh <ndw@nwalsh.com>
> Sent: Thursday, January 9, 2025 10:19 AM
> To: denis.maier@unibe.ch
> Cc: gerrit.imsieke@le-tex.de; xproc-dev@w3.org
> Subject: Re: AW: p.wrap and attributes
> 
> <denis.maier@unibe.ch> writes:
> > In a future xproc version, would it make sense to add something to 
> > cover the
> attributes here as well? Something like:
> 
> Yes, perhaps. I tend (personally) to favor small, simple composable 
> steps over large, complicated ones. After all, you've got access to 
> XQuery or XSLT if you want to do something complicated. But in the 
> steps that add elements, being able to specify attributes for those elements might make sense.
> 
> Just in passing, I'll observe that the simpler-than-XSLT workaround is:
> 
> <p:wrap match="xhtml:p[@class='reflist-item']"
>         wrapper="ex:my-random-name"
>         group-adjacent="@class"/>
> 
> <p:set-attributes match="ex:may-random-name"
>         .../>
> 
> <p:rename match="ex:my-random-name"
>           new-name="{{httpns}}div"/>
> 
>                                         Be seeing you,
>                                           norm
> 
> --
> Norm Tovey-Walsh <ndw@nwalsh.com>
> https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnorm
> %2F&data=05%7C02%7Cwendell.piez%40nist.gov%7C20dea83eda4f4109a72508dd3
> 3c9b0e8%7C2ab5d82fd8fa4797a93e054655c61dec%7C0%7C0%7C63872366353904438
> 8%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIs
> IlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=YD
> ds7ioYcTCBqqyjMYokXrNqL22Lxeyaj%2FWSgwNITsg%3D&reserved=0
> .tovey-
> walsh.com%2F&data=05%7C02%7Cdenis.maier%40unibe.ch%7Ca753a5af0
> dbf43c2e4a508dd318cf023%7Cd400387a212f43eaac7f77aa12d7977e%7C
> 1%7C0%7C638721203594387267%7CUnknown%7CTWFpbGZsb3d8eyJFbX
> B0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWF
> pbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=6zO84wqd9id%2Br0qM
> wV4o5DL%2BRlQmXF%2FSFNQMbvjbTUs%3D&reserved=0
> 
> > Life is pain...anyone who tells you differently is selling 
> > something.--Wesley (The Princess Bride)
> 

Received on Monday, 13 January 2025 19:23:55 UTC