Re: Directed vs Generic Syntax

Jeni Tennison wrote:
> 
> Hi Alex,
> 
>> Here are two steps from my tideinfo example service [1][2]:
> 
> 
> Could you explain what this second step is doing:
> 

Sure.

The regex step matches a regular expression on the text descendants.

For the *contained* steps, it binds each matched group (the bits in
parens) to a parameter named 'group-n'.

Otherwise, the input is passed unchanged to the contained steps.

The output of the 'regex' step is the output of the last contained step.

<snip>

> I think that the XSLT transformation nested within the <p:xslt> element 
> is being run with an empty source document and with the parameters 
> $group-1 to $group-4 being set to the matches identified by the 
> <p:regex> step. Right?

No.

In this example, I don't use the input document because I reconstruct
each line as a new element.  In theory, I could use both the input
document and the matched groups.

> Is the regex component being passed the XSLT transformation as an input? 
> Or does the <p:xslt> element represent a normal step? If the latter, 
> what's the difference between embedding the <p:xslt> step within the 
> <p:regex> step and linking them through the normal input/output 
> channels? How does the pipeline engine know that the subexpression 
> matches need to be assigned to the $group-1 to $group-4 parameters?

The p:xslt is a normal step.

In smallx, steps can be hierarchical--which is by choice by the step. 
So, steps can contain steps.  When the step compiles, it can compile
a contained sequence of steps of whose execution is up to the semantics
of the step.

In this case, the regex just matches the text descendants and then
passed the input to the contained sequence of steps.

> 
> Currently I don't understand why you don't have the regex component 
> generate an XML document that then acts as the input to a normal xslt 
> step: I don't understand the point of the embedding of the xslt step. 
> I'm hoping you'll enlighten me.

I hope it is more clear now.

--Alex Milowski

Received on Thursday, 20 April 2006 15:26:48 UTC