docs: private String getFromPIDataPseudoAttribute(String data, String name,
        boolean unescapeValue) {
      int pos = 0;
      while (pos <= data.length() - 4) { // minimum length of x=""
        int nextQuote = -1;
        for (int q = pos; q < data.length(); q++) {
          if (data.charAt(q) == '"' || data.charAt(q) == '\'') {
            nextQuote = q;
            break;
          }
        }
        if (nextQuote < 0) {
          return null;
          // if (nextQuote+1 == name.length()) return null;
        }
  
        int closingQuote = data.indexOf(data.charAt(nextQuote), nextQuote + 1);
        if (closingQuote < 0) {
          return null;
        }
        int nextName = data.indexOf(name, pos);
        if (nextName < 0) {
          return null;
        }
        if (nextName < nextQuote) {
          // check only spaces and equal signs between the name and the quote
          boolean found = true;
          for (int s = nextName + name.length(); s < nextQuote; s++) {
            char c = data.charAt(s);
            if (!Character.isWhitespace(c) && c != '=') {
              found = false;
              break;
            }
          }
          if (found) {
            String val = data.substring(nextQuote + 1, closingQuote);
            return unescapeValue ? unescape(val) : val;
          }
        }
        pos = closingQuote + 1;
      }
      return null;
    }