Probably not your problem. But sometimes when I've put XHTML into tags I've written the code and configured the routine name and condition... but neglected to include the Location (Top, Before <body>. etc.). Without that, the routine gets created but never called.
I've done this more than once... sigh...
Jane