Streamed optimization of xsl:copy doesn't converge
Given a streamed xsl:copy instruction where the node kind that it applies to can't be determined statically, the expression is split into two:
if (kind = (attribute, namespace, text, comment, pi)) then copy-of(.) else copy(....)
But typically the result goes through the optimizer more than once, and on the second pass through it becomes:
if (kind = (attribute, namespace, text, comment, pi)) then copy-of(.) else if (kind = (attribute, namespace, text, comment, pi)) then copy-of(.) else copy(....)
with the number of branches in the conditional increasing on each pass through the optimizer.
Seen in test case si-apply-templates-010.
#2 Updated by Michael Kay about 2 years ago
- Category set to Streaming
- Status changed from New to Resolved
- Applies to branch 9.9, trunk added
- Fix Committed on Branch 9.9, trunk added
It's difficult to come up with a better fix. Ideally if the first branch of a conditional says "test=". instance of X" then we know in subsequent branches that the context item isn't an instance of X; but doing that would be a significant step forward in our current type inferencing logic.
So I'm resolving it with this rather simplistic fix.
Please register to edit this issue