// Call this function whenever a processing instruction is encountered onPI = (string s) { // Your code here // The passed parameter s does not include the opening <? nor // closing ?> // // This is a a closure, so code here may reference // variables which are outside of this scope };
Register a handler which will be called whenever a processing instruction is encountered.