Avoid These Common Gotchas
Here are some common gotchas that developers face when getting started with EditMe development. Being aware of these up front can save you lots of time.
Don't Re-use Implicit Variable Names
Become Familiar with XML Validation Rules
EditMe page scripts must be valid XML, and there are a number of traps you can fall into that don't always provide meaningful error messages. One trick you can use to get a good validation error message every time is to save your script as a .xml file on your local hard drive and open it up with Internet Explorer. This will usually give you a very specific line numbered reason your script is invalid. Otherwise, here are some common XML validation gotchas:
- All single tags must be self-closed. For example, <br> must be <br /> and <img src=".."> must be <img src=".." />
- All tags must be properly nested. For example, <p><span></p></span> is invalid. It should be <p><span></span></p>
- Browsers don't like self-closed script tags. If your page script outputs a <script/> you'll have problems. Make sure to put a line break or space in any script tag that will be outputted to the browser.
- If you use a & in an attribute script, it must be escaped. For example <span editme="if a && b"/> won't work. It should be <span editme="if a && b"/>
- Page scripts must have a single root element enclosing the entire script. A simple <span> or <div> tag can be used for this purpose.
- Always Put Scripts in CDATA
- is invalid. Use   to force a space, or if you really want the HTML non-breaking space behavior, you can use <![CDATA[ ]]>
- For other HTML entities, see this list. Use the "Unicode code point" number to insert these. For example, for ¥ you would use ¥
- EditMe doesn't like there to be a namespace declared in a Layout. Just use <html>, not something like <html xmlns="..." lang="..">
- If you want to use a DOCTYPE in your layout, you must follow these instructions.