code: public static void replaceResourceIds(Element element, String oldId, String newId) {
  
          NodeList<Element> children = CmsDomUtil.querySelectorAll(
              FIELD_SELECTOR + ENTITY_ID_SELECTOR_PREFIX + oldId + ENTITY_ID_SELECTOR_SUFFIX,
              element);
          if (children.getLength() > 0) {
              for (int i = 0; i < children.getLength(); i++) {
                  Element child = children.getItem(i);
                  String idData = child.getAttribute(CmsGwtConstants.ATTR_DATA_ID);
                  idData = idData.replace(oldId, newId);
                  child.setAttribute(CmsGwtConstants.ATTR_DATA_ID, idData);
              }
          }
      }
docs: Replaces the id's within data-oc-id attributes of the given element and all it's children.<p>
  
  @param element the element
  @param oldId the old id
  @param newId the new id