code: public static void writeEscapedAttrValue(Writer w, String value)
          throws IOException
      {
          int i = 0;
          int len = value.length();
          do {
              int start = i;
              char c = '\u0000';
  
              for (; i < len; ++i) {
                  c = value.charAt(i);
                  if (c == '<' || c == '&' || c == '"') {
                      break;
                  }
              }
              int outLen = i - start;
              if (outLen > 0) {
                  w.write(value, start, outLen);
              }
              if (i < len) {
                  if (c == '<') {
                      w.write("&lt;");
                  } else if (c == '&') {
                      w.write("&amp;");
                  } else if (c == '"') {
                      w.write("&quot;");
  
                  }
              }
          } while (++i < len);
      }
docs: /*
  ///////////////////////////////////////////////////////////
  Static utility methods, for non-state-aware escaping
  ///////////////////////////////////////////////////////////