summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Metzler2013-05-28 16:00:08 (GMT)
committer David Metzler2013-05-28 16:00:08 (GMT)
commit806e35bc0510a8830d7492b4d4f3d8a1eff883d1 (patch)
tree40f25eb021187e7284b099e546764d06e722364e
parent63eea5239faef2a7f25d63622c5e0b67b4884773 (diff)
Added support for frx:skip_root attribute.
-rwxr-xr-xFrxReport.inc9
-rw-r--r--repos/reports/help/design.frx6
2 files changed, 11 insertions, 4 deletions
diff --git a/FrxReport.inc b/FrxReport.inc
index 9768c9e..c658262 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 78286be..860bd53 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.
</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