newDoc.body = newBody;
return true;
}
public void cascadeStyles() {
CascadeEngine engine = new CascadeEngine();
Iterator s = styleResources();
while (s.hasNext()) {
ResourceRef ref = (ResourceRef) s.next();
Resource r = ref.getResource();
if (r instanceof StyleResource) {
StyleResource sr = (StyleResource) r;
Stylesheet stylesheet = sr.getStylesheet();
if (stylesheet != null) {
CSSStylesheet css = stylesheet.getCSS();
if (css != null)
engine.add(css, null);
}
}
}
// TODO: SVG style elements
boolean notSVG = resource.getMediaType().equals("image/svg+xml");
if (notSVG) {
engine.pushElement(xhtmlns, "html", null);
engine.pushElement(xhtmlns, "head", null);
engine.popElement();
}
getBody().cascade(engine);
if (notSVG) {
engine.popElement();
}
}