Field naming in MidCOM schema
Fri 29th October 2004 21:00 EEST
Today I found a rather interesting problem in MidCOM schema field naming. It's actually pretty silly, but worthy enough to take a short blog entry.
The problem is the dash (-) character that is not allowed, among any other possible mathematical operator, in the variable names of JavaScript. Normally this doesn't give you a headache but try to use HTMLArea for that field - you'll end up with a JS error and the HTMLArea doesn't load.
To counter-act further damage, one should keep in mind the good-old variable naming conventions. Here's my cheat sheet (in addition to regular limitations of any coding language):
- Do NOT use dash (-).
- Stick to short, yet meaningful, words.
- If you really have to use more than one word, combine them with an underscore (i.e. my_variable) or use upper case first letters (i.e. myVariable).
I guess these are pretty simple things, but they are easy to forget when writing a schema, which is not at all like writing variables.
