diff --git a/FrxReport.inc b/FrxReport.inc index 9768c9eb6b1b806cdbac1c6873540eb24f7a9b5a..c65826233c45b6e834e26b927497e4316eaa99d7 100755 --- a/FrxReport.inc +++ b/FrxReport.inc @@ -173,6 +173,7 @@ class FrxReport { $frx = $node->attributes(FRX_NS); + $include_root = !isset($frx['skip_root']) || !$frx['skip_root']; $elements = $dom_node->childNodes->length; // Test to see if we have any nodes that contain data url if ($node->xpath('*//@frx:*') || $frx) { @@ -241,11 +242,11 @@ class FrxReport { foreach ($tmp_attrs as $key => $value) { $r_attr_text .= ' ' . $key . '="' . (string)$value . '"'; } - $o .= $this->teng->replace('<' . $tag . $r_attr_text . '>'); + if ($include_root) $o .= $this->teng->replace('<' . $tag . $r_attr_text . '>'); foreach ($dom_node->childNodes as $child) { $o .= $this->render_section($child); } - $o .= '' . $tag . '>'; + if ($include_root) $o .= '' . $tag . '>'; Frx::Data()->pop(); } } @@ -260,13 +261,13 @@ class FrxReport { } } else { - $o .= $this->teng->replace('<' . $tag . $attr_text . '>'); + if ($include_root) $o .= $this->teng->replace('<' . $tag . $attr_text . '>'); // None found, so render children foreach ($dom_node->childNodes as $child) { $o .= $this->render_section($child); } - $o .= '' . $tag . '>'; + if ($include_root) $o .= '' . $tag . '>'; } } if ($is_data_block && $continue) { diff --git a/repos/reports/help/design.frx b/repos/reports/help/design.frx index 78286be512472c72364d1587e715c460bb90403c..860bd53cf7a89595bbbbad3d3d6f1af9fe9a3a5c 100644 --- a/repos/reports/help/design.frx +++ b/repos/reports/help/design.frx @@ -65,6 +65,12 @@ '*', which would imply creating a a repeating pattern for every row or element returned by the query.
++ frx:skip_root attribute- This will cause the current node + of the report to not be rendered, but children will be rendered as normal. + This is most commonly used when you want the frx:foreach to not render the node + containing the frx:foreach attribute. +
Each field in the report is referenced by an xpath expression enclosed by curly braces. In its simplest form the xpath xpression can