code: public ChainWriter encodeJavaScriptStringInXmlAttribute(Object value) throws IOException {
  		// Two stage encoding:
  		//   1) Text -> JavaScript (with quotes added)
  		//   2) JavaScript -> XML Attribute
  		if(
  			value instanceof Writable
  			&& !((Writable)value).isFastToString()
  		) {
  			// Avoid unnecessary toString calls
  			textInJavaScriptEncoder.writePrefixTo(javaScriptInXhtmlAttributeWriter);
  			Coercion.write(value, textInJavaScriptEncoder, javaScriptInXhtmlAttributeWriter);
  			textInJavaScriptEncoder.writeSuffixTo(javaScriptInXhtmlAttributeWriter);
  		} else {
  			String str = Coercion.toString(value);
  			BundleLookupMarkup lookupMarkup;
  			BundleLookupThreadContext threadContext = BundleLookupThreadContext.getThreadContext(false);
  			if(threadContext!=null) {
  				lookupMarkup = threadContext.getLookupMarkup(str);
  			} else {
  				lookupMarkup = null;
  			}
  			if(lookupMarkup!=null) lookupMarkup.appendPrefixTo(MarkupType.JAVASCRIPT, javaScriptInXhtmlAttributeWriter);
  			textInJavaScriptEncoder.writePrefixTo(javaScriptInXhtmlAttributeWriter);
  			textInJavaScriptEncoder.write(str, javaScriptInXhtmlAttributeWriter);
  			textInJavaScriptEncoder.writeSuffixTo(javaScriptInXhtmlAttributeWriter);
  			if(lookupMarkup!=null) lookupMarkup.appendSuffixTo(MarkupType.JAVASCRIPT, javaScriptInXhtmlAttributeWriter);
  		}
  		return this;
  	}
docs: Encodes a javascript string for use in an XML attribute context.  Quotes
  are added around the string.  Also, if the string is translated, comments
  will be added giving the translation lookup id to aid in translation of
  server-translated values in JavaScript.
  
  @see  Coercion#toString(java.lang.Object, com.aoindustries.util.i18n.BundleLookup.MarkupType)