code: private static String getNumbering(Stack<Index> indexes, String format)
    {
      StringBuilder sb = new StringBuilder();
      int i = format.length();
      int j = i;
      int indexPosition = indexes.size() - 1;
      for(;;) {
        i = format.lastIndexOf('%', i);
        if(i == -1 && j > 0) {
          sb.insert(0, format.substring(0, j));
          break;
        }
        // if(i > 0 && format.charAt(i - 1) == '%') continue;
        if(i + 2 < format.length()) sb.insert(0, format.substring(i + 2, j));
        if(i + 1 == format.length()) continue;
  
        NumberingFormat numberingFormat = getNumberingFormat(format.charAt(i + 1));
        sb.insert(0, numberingFormat.format(indexes.get(indexPosition--).value));
        if(i == 0) break;
        j = i;
        i--;
      }
      return sb.toString();
    }
docs: Parse numbering format and inject index values. First argument,the stack of indexes, is global per serializer and format is
  the operand literal value. For nested numbering, format may contain more than one single format code; this is the reason
  first argument is the entire indexes stack, not only current index. Given a stack with four indexes those values are 1, 2,
  3 and 4 and "%S - %I.%n-%s)" the format, resulting formatted string is "A - II.3-d)".
  
  @param format numbering format.
  @return formatted numbering.