Possible, but not easy. For example, xsl:copy-of is traced
as one instruction, and it's not obvious from the trace call whether it outputs
an element node, so it's not obvious whether an element node that's subsequently
emitted derives from this instruction.
only constraint with "back mapping" is that buffering
Then Saxon could be hacked to trace events
just before the buffering step.
it would be easy to deduce an accurate mapping.
only drawback would be that attributes (and probably namespace too)
would sometimes be traced much
after the startelement()
(which is not a problem if your only concern
is the "back mapping").
NO, the buffering is done regardless of the output
The Stylus Studio debugger uses some tricks to achieve
its "back mapping" where it links elements in the result file to the
instruction that created them; this is based on some pretty hairy analysis of
the Saxon internals.
you see any trick to achieve "XSL instructions tracing" with
Does the building of
a *DOM* result also contain some buffering step? Or
is it more