Re: Step identifiers

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 07:19:01 UTC