throw new IllegalStateException(msg);
}
final CellReference cellRef = new CellReference( ref );
final CTXmlCellPr cellPr = sc.getXmlCellPr();
assert cellPr!=null;
if( cellPr==null ) {
final String msg = String.format( "cell pr for cell [%d] is null. Will be ignored", sc.getId() );
log.warn( msg);
continue;
}
log.debug( String.format( "cellPr [%s] being procesed", cellPr.getUniqueName()));
final CTXmlPr pr = cellPr.getXmlPr();
assert pr!=null;
if( pr==null ) {
final String msg = String.format( "xmlPr for cell [%d] uniqueName [%s] is null. Will be ignored", sc.getId(), cellPr.getUniqueName() );
log.warn( msg);
continue;
}
final String xpath = pr.getXpath();
assert xpath!=null;
if( xpath==null ) {
final String msg = String.format( "xpath attribute for xmlPr for cell [%d] uniqueName [%s] is null. Will be ignored", sc.getId(), cellPr.getUniqueName() );
log.warn( msg);
continue;
}
// PERFORM AN XPATH QUERY
final String xpathQuery = String.format( "$this%s", xpath );
log.debug( String.format( "perfrom xpath query [%s]", xpathQuery) );
XmlObject[] bindValues = xmlSourceObject.selectPath(xpathQuery);
assert bindValues!=null;
if( bindValues==null ) {
final String msg = String.format( "No values match for xpath query [%s] for cell [%d] uniqueName [%s]. Cell will be ignored", xpathQuery, sc.getId(), cellPr.getUniqueName() );
log.warn( msg);
continue;
}
assert bindValues.length == 1: "bindValues.length=" + bindValues.length;