docs: protected CmsXmlContentErrorHandler validateCategories(
          CmsObject cms,
          I_CmsXmlContentValue value,
          CmsXmlContentErrorHandler errorHandler) {
  
          if (!value.isSimpleType()) {
              // do not validate complex types
              return errorHandler;
          }
          I_CmsWidget widget = null;
  
          widget = CmsWidgetUtil.collectWidgetInfo(value).getWidget();
          if (!(widget instanceof CmsCategoryWidget)) {
              // do not validate widget that are not category widgets
              return errorHandler;
          }
          String stringValue = value.getStringValue(cms);
          if (stringValue.isEmpty()) {
              return errorHandler;
          }
          try {
              String[] values = stringValue.split(",");
              for (int i = 0; i < values.length; i++) {
                  String val = values[i];
                  String catPath = CmsCategoryService.getInstance().getCategory(cms, val).getPath();
                  String refPath = getReferencePath(cms, value);
                  CmsCategoryService.getInstance().readCategory(cms, catPath, refPath);
                  if (((CmsCategoryWidget)widget).isOnlyLeafs()) {
                      if (!CmsCategoryService.getInstance().readCategories(cms, catPath, false, refPath).isEmpty()) {
                          errorHandler.addError(
                              value,
                              Messages.get().getBundle(value.getLocale()).key(
                                  Messages.GUI_CATEGORY_CHECK_NOLEAF_ERROR_0));
                      }
                  }
              }
          } catch (CmsDataAccessException e) {
              // expected error in case of empty/invalid value
              // see CmsCategory#getCategoryPath(String, String)
              if (LOG.isDebugEnabled()) {
                  LOG.debug(e.getLocalizedMessage(), e);
              }
              errorHandler.addError(
                  value,
                  Messages.get().getBundle(value.getLocale()).key(Messages.GUI_CATEGORY_CHECK_EMPTY_ERROR_0));
          } catch (CmsException e) {
              // unexpected error
              if (LOG.isErrorEnabled()) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
              errorHandler.addError(value, e.getLocalizedMessage());
          }
          return errorHandler;
      }