original_string: protected function validate_name($name) {
          // Validate various name constraints, throwing exception if needed
          if (empty($name)) {
              throw new convert_path_exception('convert_path_emptyname', $name);
          }
          if (preg_replace('/\s/', '', $name) != $name) {
              throw new convert_path_exception('convert_path_whitespace', $name);
          }
          if (preg_replace('/[^\x30-\x39\x41-\x5a\x5f\x61-\x7a]/', '', $name) != $name) {
              throw new convert_path_exception('convert_path_notasciiname', $name);
          }
      }
code: protected function validate_name($name) {
          // Validate various name constraints, throwing exception if needed
          if (empty($name)) {
              throw new convert_path_exception('convert_path_emptyname', $name);
          }
          if (preg_replace('/\s/', '', $name) != $name) {
              throw new convert_path_exception('convert_path_whitespace', $name);
          }
          if (preg_replace('/[^\x30-\x39\x41-\x5a\x5f\x61-\x7a]/', '', $name) != $name) {
              throw new convert_path_exception('convert_path_notasciiname', $name);
          }
      }
code_tokens: protected function validate_name ( $ name ) { // Validate various name constraints, throwing exception if needed if ( empty ( $ name ) ) { throw new convert_path_exception ( 'convert_path_emptyname' , $ name ) ; } if ( preg_replace ( '/\s/' , '' , $ name ) != $ name ) { throw new convert_path_exception ( 'convert_path_whitespace' , $ name ) ; } if ( preg_replace ( '/[^\x30-\x39\x41-\x5a\x5f\x61-\x7a]/' , '' , $ name ) != $ name ) { throw new convert_path_exception ( 'convert_path_notasciiname' , $ name ) ; } }
docstring: Makes sure the given name is a valid element name
  
  Note it may look as if we used exceptions for code flow control here. That's not the case
  as we actually validate the code, not the user data. And the code is supposed to be
  correct.
  
  @param string @name the element given name
  @throws convert_path_exception
  @return void
docstring_tokens: Makes sure the given name is a valid element name