37497: Templates should escape string literals in resource files

If the user enters an activity title like "Android's Tools" in the new
template wizard, an invalid strings.xml file is generated, since the
apostrophe is not properly escaped.

To fix this, there's a new string conversion method in the template
engine, "escapeXmlString", which will perform all the necessary
conversions.

It also adds two other XML escaping functions: one to escape text to
be suitable for XML attribute values, and one to be suitable for XML
text values.

Finally, when verifying this, I discovered that if I inserted
ampersands in the MasterDetail template, I ended up with errors in
various places there a filename was derived from the input string. To
help make this work better, there's also a new "extractLetters" method
which pulls all the characters out of a string (effectively stripping
whitespace and punctuation).

In addition to the above 4 new string conversion methods, the
templates have been updated to use them, and the template format
documentation updated.

Change-Id: I4d4e854ab78d63bc86b8eb0fb9d92246534615e7
22 files changed