Hi Lauren
There's a fairly straightforward hack: you can temporarily replace the main document part's content list with just the content of interest (in this case your SdtContentBlock's), perform the conversion, then swap it back again.
Alternatively, HtmlExporterNonXSLT contains:
Using java Syntax Highlighting
public org.
w3c.
dom.
Document export
(Object blockLevelContent,
String cssClass,
String cssId
) {
HTMLConversionContext conversionContext
=
new HTMLConversionContext
(htmlSettings,
null,
null);
Document document
= XmlUtils.
neww3cDomDocument();
Element parentNode
= document.
createElement("div");
AbstractVisitorExporterGenerator
<HTMLConversionContext
> generator
= null;
if (cssClass
!=null) {
parentNode.
setAttribute("class", cssClass
);
}
if (cssId
!=null) {
parentNode.
setAttribute("id", cssId
);
}
document.
appendChild(parentNode
);
generator
= HTMLExporterVisitorGenerator.
GENERATOR_FACTORY.
createInstance(conversionContext, document, parentNode
);
new TraversalUtil
(blockLevelContent, generator
);
return document
;
}
Parsed in 0.016 seconds, using
GeSHi 1.0.8.4
but the Javadoc warns of cases where it might not work.