[xsl] Stylesheet composition

Subject: [xsl] Stylesheet composition
From: Garvin Riensche <g.riensche@xxxxxxx>
Date: Thu, 15 Nov 2007 18:42:00 +0100
Hello,

I am currently thinking about the limitations of stylesheet compositions. As far as I know stylesheets can run after another where the subsequent one might work on the complete result of the precesding one (using temporary trees). I think it is impossible to let the second stylesheet run only on the data the first one added to the source xml without changing the stylesheets. Let me pose an example:

XML:
<aaa>1</aaa>
<aaa>2>/aaa>

Stylesheet1 just adds some more <aaa> to the source, so that the xml after the transformation looks like:

<aaa>1</aaa>
<aaa>2</aaa>
<aaa>3</aaa>
<aaa>4</aaa>

Stylesheet2 matches the "aaa" elements and applies some transformation, e.g. an addition, plus one, so that the output would be:

<aaa>2</aaa>
<aaa>3</aaa>
<aaa>4</aaa>
<aaa>5</aaa>

My question is the following: Is it possible, without changing stylesheet1 or stylesheet2, to let stylesheet2 run only on the elements stylesheet1 has added, so that the output would look like:

<aaa>1</aaa>
<aaa>2</aaa>
<aaa>4</aaa>
<aaa>5</aaa>
?

If this is not possible, would this be something the XML community is interested in?
I think it would be nice to have some kind of operator that would tell the second stylesheet if it should work on the complete result of the first one or only on the added elements.


Has someone already done any research about the limitations of stylesheet composition and proposed an improvement? Or is the XML community just fine with current facilities of stylesheet composition?

regards,
Garvin Riensche

Current Thread