throws SAXException
{
List<Resource> contexts = new ArrayList<Resource>();
for (int i = startIdx; i < parsedValues.size(); i++) {
Value contextCandidate = parsedValues.get(startIdx);
if (contextCandidate == null || contextCandidate instanceof Resource) {
contexts.add((Resource)contextCandidate);
}
else {
throw new SAXException("Invalid context value: " + contextCandidate.getClass());
}
}
return contexts.toArray(new Resource[contexts.size()]);
}