Commit 806e35bc authored by metzlerd's avatar metzlerd
Browse files

Added support for frx:skip_root attribute.

parent 63eea523
......@@ -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) {
......
......@@ -65,6 +65,12 @@
'*', which would imply creating a a repeating pattern for every row or
element returned by the query.
</p>
<p id="skip_root">
<strong>frx:skip_root attribute</strong>- 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.
</p>
<h2>Report fields</h2>
<p>Each field in the report is referenced by an xpath expression
enclosed by curly braces. In its simplest form the xpath xpression can
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment