/**
* Returns the low level notes object for the given
* slide, as found from the supplied slide reference
*/
public CTNotesSlide getNotes(CTSlideIdListEntry slide) throws IOException, XmlException {
PackagePart slidePart =
getRelatedPackagePart(slide.getId2());
PackageRelationshipCollection notes;
try {
notes = slidePart.getRelationshipsByType(NOTES_RELATION_TYPE);
} catch(InvalidFormatException e) {
throw new IllegalStateException(e);
}
if(notes.size() == 0) {
// No notes for this slide
return null;
}
if(notes.size() > 1) {
throw new IllegalStateException("Expecting 0 or 1 notes for a slide, but found " + notes.size());
}
PackagePart notesPart =
getPackagePart(notes.getRelationship(0));
NotesDocument notesDoc =
NotesDocument.Factory.parse(notesPart.getInputStream());
return notesDoc.getNotes();
}