Re: Step identifiers

The other issue is that something like doc(static-base-uri())//p:declare-step/@name doesn’t work for steps that are declared in a p:library or in another p:declare-step.

A processor could expose the names and types in extension functions, or we could contemplate introducing p:step-name() and p:step-type() functions.

Sheila, how are you going to implement the reflection framework that you are conceiving? If reflection messages are added to the pipelines by transforming their XML content before they are executed, you might as well generate the my:stepname and my:steptype variable declarations in the course of this transformation.

Gerrit

On 16.07.2025 09:18, Norm Tovey-Walsh wrote:
> Sheila Thomson <discuss@bluegumtree.com> writes:
>> I have another reflection question.  Is there a way to get any of the following from within a step about itself:
>>
>> * name (/p:declare-step/@name)
>> * type (/p:declare-step/@type)
>> * URI
> 
> I think the static-base-uri() will give you the URI of the step but that might not be its location on the filesystem (someone could have used xml:base on it) and it might not be the only step with that base URI, it could be within a p:library, for example.
> 
> Name and type are not really available. On one level, they’re an artifact of the surface syntax. After the pipeline has worked out what the steps are (from their types) and how the inputs and outputs are connected together (from their names), neither the type nor the name are really needed anymore.
> 
> You could fake it in a somewhat ugly fashion by having a convention:
> 
>    <p:declare-step name="main" type="ex:mystep" …>
>      <p:variable name="my:stepname" select="'main'"/>
>      <p:variable name="my:steptype" select="QName('ex:mystep')"/>
> 
> But I assume this is for status and debugging messages and you’d rather not have the chance of a copy-and-paste error giving you misleading details.
> 
> I expect my implementation keeps the names and types around, but they aren’t exposed anywhere, as far as I can recall.
> 
>                                          Be seeing you,
>                                            norm
> 
> --
> Norm Tovey-Walsh <ndw@nwalsh.com>
> https://norm.tovey-walsh.com/
> 
>> He would like to start from scratch. Where is scratch?--Elias Canetti
> 

Received on Wednesday, 16 July 2025 08:00:35 UTC