for (int i=0; i<=ilvl.intValue(); i++) {
listSpec = new ListSpec(numId, BigInteger.valueOf(i));
listSpec.sdtList = new SdtBlock();
setTag(listSpec.sdtList, numId, ilvl);
listSpec.sdtList.setSdtContent(new SdtContentBlock());
if (listStack.peek()==null) {
resultElts.add(listSpec.sdtList);
} else {
listStack.peek().sdtList.getSdtContent().getContent().add(listSpec.sdtList);
}
listStack.push(listSpec);
}
listSpec.sdtList.getSdtContent().getContent().add(paragraph);
} else if (numId==null) {
log.error("TODO: encountered null numId!");
closeAllLists();
resultElts.add(o);
continue;
} else // (numId.equals(listSpec.numId))
{
// same list
if (ilvl.equals(listSpec.ilvl)) {
// just add to it
} else if (ilvl.compareTo(listSpec.ilvl)>0) {
// deeper, so add levels
for (int i=listSpec.ilvl.intValue(); i<ilvl.intValue(); i++) {
listSpec = new ListSpec(numId, BigInteger.valueOf(i));
listSpec.sdtList = new SdtBlock();
setTag(listSpec.sdtList, numId, ilvl);
listSpec.sdtList.setSdtContent(new SdtContentBlock());
if (listStack.peek()==null) {
resultElts.add(listSpec.sdtList);
} else {
listStack.peek().sdtList.getSdtContent().getContent().add(listSpec.sdtList);