In stylesheet.cls.php, apply_styles() produces a warning (in Drupal) when the XPath query contains "/following-sibling::".
* warning: DOMXPath::query() [domxpath.query]: Invalid expression in /home/mindcraf/public_html/drupal6/sites/all/modules/print/dompdf/include/stylesheet.cls.php on line 576.
* warning: DOMXPath::query() [domxpath.query]: Invalid expression in /home/mindcraf/public_html/drupal6/sites/all/modules/print/dompdf/include/stylesheet.cls.php on line 576.
* warning: Invalid argument supplied for foreach() in /home/mindcraf/public_html/drupal6/sites/all/modules/print/dompdf/include/stylesheet.cls.php on line 578.
I don't know XPath, so I couldn't fix it, but I applied the following workaround:
function apply_styles(Frame_Tree $tree) {
...
// FIXME: this is not particularly robust...
...
// Apply all styles in stylesheet
foreach ($this->_styles as $selector => $style) {
$query = $this->_css_selector_to_xpath($selector);
if ((strpos($query, "following-sibling::") === FALSE)) { // MZN -- Fixes warning messages
// Retrieve the nodes
...
$styles[$id][$spec][] = $style;
}
} // MZN
}
stylesheet.cls.php with workaround