Code to remove text-based attributes, based on your code, is now in the trunk as revision 199.
To avoid most of the recursion and performance penalty, I've taken the liberty to add caching to the function by creating a custom attribute called 'mayContainTextNodes' on the nodes.
Code to remove text-based attributes, based on your code, is now in the trunk as revision 199.
To avoid most of the recursion and performance penalty, I've taken the liberty to add caching to the function by creating a custom attribute called 'mayContainText Nodes' on the nodes.
Thanks for your bug report and code submission.