Name

labeled_data_row —

ATTRIBUTES

Attribute Pos. Req. Default Description

DESCRIPTION

BEHAVIOR

This tag does not appear to be affected by, or affect, the rest of Interchange.

EXAMPLES

No examples are available at this time. We do consider this a problem and will try to supply some.

NOTES

AVAILABILITY

labeled_data_row is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Interpolate.pm
Lines: 3589

sub tag_labeled_data_row {
my ($key, $text) = @_;
my ($row, $table, $tabRE);
my $done;
my $prefix;

if(defined $Prefix) {
  $prefix = $Prefix;
  undef $Prefix;
  $LdB = qr(\[$prefix[-_]data$Spacef)i;
  $LdIB = qr(\[if[-_]$prefix[-_]data(\d*)$Spacef(!?)(?:%20|\s)*)i;
  $LdIE = qr(\[/if[-_]$prefix[-_]data)i;
  $LdExpr = qr{ \[(?:$prefix[-_]data|if[-_]$prefix[-_]data(\d*))
                \s+ !?\s* ($Codere) \s
        (?!$All\[(?:$prefix[-_]data|if[-_]$prefix[-_]data\1))  }xi;
  %Data_cache = ();
}
# Want the last one
#::logDebug(<<EOF);
#tag_labeled_data_row:
#  prefix=$prefix
#  LdB   =$LdB
#  LdIB  =$LdIB
#  LdIE  =$LdIE
#  LdD   =$LdD
#  LdI   =$LdI
#  LdExpr=$LdExpr
#EOF

  while($$text =~ $LdExpr) {
  $table = $2;
  $tabRE = qr/$table/;
  $row = $Data_cache{"$table.$key"}
      || ( $Data_cache{"$table.$key"}
          = Vend::Data::database_row($table, $key)
        )
      || {};
  $done = 1;
  $$text =~ s#$LdIB$tabRE$LdI$LdIE\1\]#
        $row->{$3}  ? pull_if($5,$2,$4,$row->{$3})
              : pull_else($5,$2,$4,$row->{$3})#ge
    and undef $done;
#::logDebug("after if: table=$table 1=$1 2=$2 3=$3 $$text =~ s#$LdIB $tabRE $LdI $LdIE#");

  $$text =~ s/$LdB$tabRE$LdD/ed($row->{$1})/eg
    and undef $done;
  last if $done;
}
return $_;
}

AUTHORS

Interchange Development Group

SEE ALSO

DocBook! Interchange!