}
private IStructuredTextPartitioner createStructuredTextPartitioner(IStructuredDocument structuredDocument) {
IStructuredTextPartitioner result = null;
// this same detector should underly content describer, to have consistent results
JSPDocumentHeadContentDetector jspHeadContentDetector = new JSPDocumentHeadContentDetector();
jspHeadContentDetector.set(structuredDocument);
String contentType = null;
try {
contentType = jspHeadContentDetector.getContentType();
// if XHTML or WML, that trumps what is in the page directive
if (jspHeadContentDetector.isXHTML() || jspHeadContentDetector.isWML()) {
contentType = "text/html";
}
}
catch (IOException e) {
// impossible in this context, since working with document stream