if (o instanceof org.docx4j.wml.SdtBlock
|| o instanceof org.docx4j.wml.SdtRun
|| o instanceof org.docx4j.wml.CTSdtRow
|| o instanceof org.docx4j.wml.CTSdtCell ) {
SdtPr sdtPr = OpenDoPEHandler.getSdtPr(o);
if (sdtPr!=null) {
log.debug("Processing " + OpenDoPEHandler.getSdtPr(o).getId().getVal());
Tag tag = sdtPr.getTag();
log.debug(tag.getVal());
HashMap<String, String> map = QueryString.parseQueryString(tag.getVal(), true);
String conditionId = map.get(OpenDoPEHandler.BINDING_ROLE_CONDITIONAL);
String repeatId = map.get(OpenDoPEHandler.BINDING_ROLE_REPEAT);
if (conditionId != null) {
conditionSdtsByID.put(sdtPr.getId().getVal(), o);
} else if (repeatId != null) {
repeatSdtsByID.put(sdtPr.getId().getVal(), o);
} else if (instanceCountOnly) {
String resultConditionId = map.get(OpenDoPEHandler.BINDING_RESULT_CONDITION_FALSE);
String resultRepeatId = map.get(OpenDoPEHandler.BINDING_RESULT_RPTD);
String resultRptdZeroId = map.get(OpenDoPEHandler.BINDING_RESULT_RPTD_ZERO);
if (resultConditionId != null) {
conditionSdtsByID.put(sdtPr.getId().getVal(), o);
} else if (resultRptdZeroId != null) {
repeatSdtsByID.put(sdtPr.getId().getVal(), o);
} else if (resultRepeatId != null) {
repeatSdtsByID.put(sdtPr.getId().getVal(), o);
}
}
// not bothering to count plain binds
}
}