Emanuele D'Arrigo wrote:
OTOH, I expect little XSLT code to really depend on this,
You are probably right -now-, but if the functionality becomes available I suspect it'd be quickly adopted for all sorts of unforeseen purposes.
and it's easy to work around by wrapping the element in an ElementTree object.
I didn't get this. The negatively important thing is that the element is not "in-context" when it's transformed. How would wrapping it in an ElementTree object help?
I meant the opposite: If we switch the way it works, I don't expect much code to break, and if it does, it'll be easy to fix by wrapping the element in an ElementTree object before passing it to the transformer. I'm not sure how hard this will be to implement, though. I didn't find an obvious function in libxslt that would take a context/start element in addition to the document to be transformed, so someone needs to investigate how libxslt works here (we normally call the xsltApplyStylesheetUser() function), and what it takes to start the transform from a different node (e.g. if calling xsltProcessOneNode() works out-of-the-box, or if there is a setup required beforehand). Could you file a feature request (i.e. bug) on the bug tracker for now? Stefan