List of usage examples for org.w3c.dom.css CSSStyleDeclaration getCssText
public String getCssText();
From source file:com.xpn.xwiki.pdf.impl.PdfExportImpl.java
/** * Recursively inline the computed style that applies to a DOM Element into the {@code style} attribute of that * Element.// ww w .j av a 2 s. c o m * * @param element the Element whose style should be inlined */ private void applyInlineStyle(Element element) { for (int i = 0; i < element.nodeCount(); i++) { org.dom4j.Node node = element.node(i); if (node instanceof CSSStylableElement) { CSSStylableElement styleElement = (CSSStylableElement) node; CSSStyleDeclaration style = styleElement.getComputedStyle(); if (style != null && StringUtils.isNotEmpty(style.getCssText())) { styleElement.addAttribute("style", styleElement.getComputedStyle().getCssText()); } } if (node instanceof Element) { applyInlineStyle((Element) node); } } }