toAttribute static method
Returns a valid attribute structure key="value" from 2 strings
Returns an empty String if invalid characters are present in either String
Implementation
static String toAttribute(String name, String value)
{
String xml = "";
if ((!hasIllegalCharacters(name)) && (!hasIllegalCharacters(value))) xml = " $name=\"$value\"";
return xml;
}