Embperl

 view release on metacpan or  search on metacpan

Embperl/Form/Control.pm  view on Meta::CPAN

# ---------------------------------------------------------------------------
#
#   get_value - return the current value for the control
#               if dataprefix is set, every hash key within dataprefix is tried
#

sub get_value
    {
    my ($self, $req) = @_ ;
    
    my $fdat       = $req -> {docdata} || \%Embperl::fdat ;
    my $name       = $self -> {srcname} || $self -> {force_name} || $self -> {name} ;
    return $fdat -> {$name} ;
    my $dataprefix = $self -> {dataprefix} ;

    return $fdat -> {$name} if (!$dataprefix) ;
    
    foreach my $prefix (@$dataprefix)
        {
        my $item = $prefix?$fdat -> {$prefix}{$name}:$fdat -> {$name} ;
        return $item if (defined ($item)) ;

Embperl/Form/Control/age.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req, $parentctrl, $force) = @_ ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my $val     = $fdat->{$name} ;
    return if ($val eq '' || ($req -> {"ef_age_init_done_$name"} && !$force)) ;

    my ($age, $tooltip) = $self -> $self -> get_display_text ($req, $val) ;

    $fdat->{$name} = $age;
    $fdat->{'_tt_' . $name} = $tooltip ;
    $req -> {"ef_age_init_done_$name"} = 1 ;
    }

Embperl/Form/Control/checkbox.pm  view on Meta::CPAN


sub init_data
    {
    my ($self, $req, $grid) = @_ ;
    
    return if (!$self -> is_readonly() && (!$grid || !$grid -> is_readonly())) ;
    
    my $val = $self -> get_value ($req) ;
    my $value      = $self -> {value} ;
    $value = 1 if ($value eq '') ;
    my $fdat       = $req -> {docdata} || \%Embperl::fdat ;
    $fdat -> {"_opt_$self->{name}"} = $value eq $val?'X':'-' ;
    }

# ---------------------------------------------------------------------------
#
#   show_control_readonly - output readonly control
#

sub xshow_control_readonly
    {

Embperl/Form/Control/checkbox.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   get_display_text - returns the text that should be displayed
#

sub get_display_text
    {
    my ($self, $req, $value) = @_ ;

    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name     = $self -> {name} ;
    my $val      = $self -> {value} ;
    $val = 1 if ($val eq '') ;
    
    return $value eq $val?'X':'-' if (defined ($value)) ;
    return $fdat->{$name} eq $val?'X':'-' ;
    }

# ---------------------------------------------------------------------------
#

Embperl/Form/Control/checkbox.pm  view on Meta::CPAN


    {
    my ($self, $req, $parentctl, $method) = @_ ;

    return if (!$self -> is_readonly($req) && (! $parentctl || ! $parentctl -> is_readonly($req))) ;
    
    my $val = $self -> get_value ($req) ;
    if ($val ne '')
        {
        my $name = $self -> {name} ;
        my $fdat = $req -> {docdata} || \%Embperl::fdat ;
        my $opt  = $self -> get_display_text ($req, $val) ;
        $fdat -> {'_opt_' . $name} = $opt if ($opt ne '') ;
        }
    }

# ---------------------------------------------------------------------------
#
#   label_text - return text of label
#

Embperl/Form/Control/checkboxes.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req) = @_ ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    if (ref $fdat -> {$name})
        {
        $fdat -> {$name} = join ("\t", @{$fdat -> {$name}}) ;    
        }

    }

# ------------------------------------------------------------------------------------------
#

Embperl/Form/Control/datetime.pm  view on Meta::CPAN

    
# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req, $parentctrl, $force) = @_ ;

    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my $time    = $fdat->{$name} ;

    return if (($time eq '' && !exists $self -> {onempty}) || $self -> {format} eq '-' || ($req -> {"ef_datetime_init_done_$name"} && !$force)) ;

    $fdat->{$name} = $self -> get_display_text ($req, $time) ;
    $req -> {"ef_datetime_init_done_$name"} = 1 ;
    }

# ---------------------------------------------------------------------------

Embperl/Form/Control/display.pm  view on Meta::CPAN

# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req, $parentctrl) = @_ ;

    
    my $fdat    = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my $value   = $fdat->{$name} ;

    $value = [ split /\t/, $value ] if $self->{split};
    $value = [ split /\n/, $value ] if $self->{splitlines};
    


    if ($self -> {value2text})
        {

Embperl/Form/Control/display.pm  view on Meta::CPAN

# ---------------------------------------------------------------------------
#
#   init_markup - add any dynamic markup to the form data
#

sub init_markup

    {
    my ($self, $req, $parentctl, $method) = @_ ;

    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name  = $self->{name} ;
    my $value = $fdat->{$name} ;
    $value = [ split /\t/, $value ] if $self->{split};
    $value = [ split /\n/, $value ] if $self->{splitlines};
    if (ref $value eq 'ARRAY')
        {
        @$value = map { $_ = HTML::Escape::escape_html ($_) } @$value ;
        $fdat->{$name} = join ("<br>\n", @$value) ;
        }
    else

Embperl/Form/Control/duration.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req, $parentctrl, $force) = @_ ;

    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my $time    = $fdat->{$name} ;
    return if ($time eq '' || ($req -> {"ef_duration_init_done_$name"} && !$force)) ;

    $fdat->{$name} = $self -> get_display_text ($req, $time) ;
    $req -> {"ef_duration_init_done_$name"} = 1 ;
    }

# ---------------------------------------------------------------------------
#

Embperl/Form/Control/grid.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req) = @_ ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $ldap    = $req->{ldap};
    my $name    = $self->{name} ;
    my $rowno   = 1 ;
    my $fields  = $self -> {fields} ;
    my @entries = ref $fdat->{$name} eq 'ARRAY'?@{$fdat->{$name}}:
                  ref $fdat->{$name} eq 'HASH' ?init_data_hash ($rowno, $fdat->{$name}, $fields):
                                                split("\t",$fdat->{$name});
    my $line2   = $self -> {line2} ;
    my $order   = $self -> {order} ;
    my $order_desc   = $self -> {order_desc} ;

Embperl/Form/Control/grid.pm  view on Meta::CPAN

#
#   init_markup
#

sub init_markup
    {
    my ($self, $req, $grid, $method) = @_ ;
    
    $self -> init_data ($req) if ($self -> is_readonly()) ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my $i ;
    my $j ;
    my $max = $fdat->{"__${name}_max"} ;
    my $fields  = $self -> {fields} ;
    my $line2   = $self -> {line2} ;

    foreach $i (0..$max, '%row%')
        {
        $j = 0 ;

Embperl/Form/Control/grid.pm  view on Meta::CPAN

    my ($self, $req, $value) = @_ ;
    
    return '' if (!ref $value) ;
    
    my $name       = $self -> {name} ;
    my $fields     = $self -> {'fields'};
    my $showfields = $req -> {'grid_gtf_' . $name} ;
    my $allfields  = $req -> {'grid_gta_' . $name} ;
    if (!$showfields)
        {
        my $fdat = $req -> {docdata} || \%Embperl::fdat ;
        my $max    = $fdat -> {"__${name}_max"}  ||= 0 ;
        my $flat   = $self -> {flat} ;
        my @flat   = split /\s*;\s*/, $flat ;
        my $i = 0 ;
        my @fields ;
        my %fields ;
        foreach my $field (@$fields)
            {
            $fields{$field -> {name}} = $i ;
            push @fields, $field -> {name} ;

Embperl/Form/Control/inputjoin.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req) = @_ ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name  = $self -> {name} ;
    my $split = $self -> {split} || $self -> {join} ;
    my $num   = $self -> {numinputs} || 1 ;
    my $i     = 0 ;
    my @vals  = split /$split/, $fdat->{$name} ;
    for (my $i = 0; $i < $num; $i++)
	{
	$fdat->{"$name-_-$i"} = $vals[$i] ;
	}
    }

Embperl/Form/Control/mult.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req) = @_ ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my @entries = ref $fdat->{$name} eq 'ARRAY'?@{$fdat->{$name}}:split("\t",$fdat->{$name});

    my $field = $self -> {fields}[0] ;    
    my $i = 0 ;
    my @opt ;
    my @data ;
    foreach my $entry (@entries)
        {
        $fdat->{"__${name}__$i"} = $entry ;

Embperl/Form/Control/number.pm  view on Meta::CPAN


# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req, $parentctrl, $force) = @_ ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my $val     = $fdat->{$name} ;
    return if ($val eq '' || (!$force && $req -> {"ef_number_init_done_$name"})) ;

    my $num = $self -> get_display_text ($req, $val, 1) ;

    $fdat->{$name} = $num ;
    $req -> {"ef_number_init_done_$name"} = 1 ;
    }

Embperl/Form/Control/number.pm  view on Meta::CPAN

#   init_markup - add any dynamic markup to the form data
#

sub init_markup

    {
    my ($self, $req, $parentctl, $method) = @_ ;

    return if (!$self -> is_readonly($req) && (! $parentctl || ! $parentctl -> is_readonly($req))) ;
    
    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;
    my $val     = $fdat->{$name} ;
    return if ($val eq '' || ($req -> {"ef_number_init_done_$name"})) ;

    my $num = $self -> get_display_text ($req, $val) ;

    $fdat->{$name} = $num ;
    $req -> {"ef_number_init_done_$name"} = 1 ;
    }

Embperl/Form/Control/password.pm  view on Meta::CPAN

    
# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req, $parentctrl) = @_ ;

    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name    = $self->{name} ;

    $fdat->{$name} = $fdat->{$name}?'********':'' ;
    
    my $retype_name = $self->{retype_name} ;
    $fdat->{$retype_name} = $fdat->{$name} if ($retype_name) ;
    }

# ------------------------------------------------------------------------------------------
#

Embperl/Form/Control/select.pm  view on Meta::CPAN

    return $v ;
    }

sub show_control
    {
    my ($self, $req, $filter) = @_ ;

push @{$req -> {timing}}, ([Time::HiRes::gettimeofday()], 'start show_control ' . $self->{name} . ' ' . __FILE__ . '#' . __LINE__) if ($req -> {timing});
    
    my $name     = $self -> {name} ;
    my $fdat     = $req -> {docdata} || \%Embperl::fdat ;
    my $value    = $fdat -> {$name} ;
    $Embperl::idat{$name} = $value ;
    $filter      ||= $self -> {filter} ;
    my $nsprefix = $self -> form -> {jsnamespace} ;
    my $val ;
    my $i = 0 ;
    my ($values, $options) = $self -> get_all_values ($req) ;
    my ($ctlattrs, $ctlid, $ctlname) =  $self -> get_std_control_attr($req) ;
    $values ||= [] ;

Embperl/Form/Control/selectdyn.pm  view on Meta::CPAN

#

sub init_data
    {
    my ($self, $req) = @_ ;

    my $val = $self -> get_value ($req) ;
    if ($val ne '')
        {
        my $name = $self -> {name} ;
        my $fdat = $req -> {docdata} || \%Embperl::fdat ;
        $fdat -> {'_opt_' . $name} = $self -> get_option_from_value ($val, $req) ;
        $fdat -> {'_id_' .  $name} = $self -> get_id_from_value ($val, $req) ;
        }
    }
    
# ------------------------------------------------------------------------------------------
#
#   prepare_fdat - daten zusammenfuehren
#

Embperl/Form/Control/textarea.pm  view on Meta::CPAN

# ------------------------------------------------------------------------------------------
#
#   init_data - daten aufteilen
#

sub init_data
    {
    my ($self, $req, $parentctrl, $force) = @_ ;


    my $fdat  = $req -> {docdata} || \%fdat ;
    my $name  = $self->{name} ;
    return if (!exists $fdat->{$name} || $req -> {"ef_textarea_init_done_$name"}) ;

    if ($self -> {format} ne 'html')
        {
        if ($self -> is_readonly ($req))
            {
            $self -> _text2pre (\$fdat->{$name}) ;
            }
        }

Embperl/Form/ControlMultValue.pm  view on Meta::CPAN


    {
    my ($self, $req, $parentctl, $method) = @_ ;

    return if (!$self -> is_readonly($req) && (! $parentctl || ! $parentctl -> is_readonly($req))) ;

    my $val = $self -> get_value ($req) ;
    if ($val ne '')
        {
        my $name = $self -> {name} ;
        my $fdat = $req -> {docdata} || \%Embperl::fdat ;
        my $opt  = $self -> get_display_text ($req, $val) ;
        my $id   = $self -> get_id_from_value ($val, $req) ;
        $fdat -> {'_opt_' . $name} = $opt if ($opt ne '') ;
        $fdat -> {'_id_' .  $name} = $id  if ($id ne '') ;
        }
    }

# ------------------------------------------------------------------------------------------
#
#   prepare_fdat - daten zusammenfuehren

Embperl/Syntax.pm  view on Meta::CPAN

specfify a nodname.

=item 'unescape' => 1

If C<optRawInput> isn't set unescape the data of the inside the node

=item 'nodetype'   => ntypEndTag

Type of the node

=item 'cdatatype'  => ntypAttrValue

Type of nodes for data (which is not matched by 'inside' definitions) inside
this node. Set to zero to not generate any nodes for text inside of this node,
other then these that are matched by a 'inside' definition.

=item 'endtag'

Name of the tag that marks the end of a block. This is used by the parser
to track correct nesting.

Embperl/Syntax.pm  view on Meta::CPAN


1 means put the following code into normal code which is executed every time the page is
requested

2 means put the following code put into code which is executed direct after compilation.
This is mainly for defining subs, or using modules etc.


=item addflags

=item cdatatype

=item forcetype

=item insidemustexist

=item matchall

=item exitinside

=item addfirstchild

Embperl/Syntax/EmbperlBlocks.pm  view on Meta::CPAN

    my ($self, $cmdname, $procinfo, $taginfo) = @_ ;

    my $tagtype = 'Embperl meta command' ;
    my $ttref ;
    die "'$tagtype' unknown" if (!($ttref = $self -> {-epbBlocks}{$tagtype})) ;
    my $ttfollow = ($ttref -> {'follow'} ||= {}) ;

    my $tag = $ttfollow -> {$cmdname} = { 
                                'text'      => $cmdname,
                                'nodetype'  => ntypTag,
                                'cdatatype' => ntypAttrValue,
                                'forcetype' => 1,
                                'unescape'  => 1,
                                (ref($taginfo) eq 'HASH'?%$taginfo:()),
                              } ;
    $tag -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo } if ($procinfo) ;

    die "'$tagtype' unknown" if (!($ttref = $self -> {-epbBlocksLink}{$tagtype})) ;
    $ttfollow = ($ttref -> {'follow'} ||= {}) ;

    my $tag2 = $ttfollow -> {$cmdname} = { 
                                'text'      => $cmdname,
                                'nodetype'  => ntypTag,
                                'cdatatype' => ntypAttrValue,
                                'forcetype' => 1,
                                'unescape'  => 2,
                                (ref($taginfo) eq 'HASH'?%$taginfo:()),
                              } ;
    $tag2 -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo } if ($procinfo) ;

    return $tag ;
    }


Embperl/Syntax/EmbperlBlocks.pm  view on Meta::CPAN

                compilechilds => 0,
                removenode  => 3, 
                },
            },
        },
     'Embperl output msg id' => {
        'text' => '[=',
        'end'  => '=]',
        'unescape' => 1,
         removespaces  => 72,
        'cdatatype' => ntypAttrValue,
        'procinfo' => {
            embperl => { 
                    perlcode => 
                        [
                        '_ep_rpid(%$x%,scalar(%&\'<noname>%));', 
			],
                    removenode  => 4,
                    compilechilds => 0,
                    }
            },

Embperl/Syntax/EmbperlHTML.pm  view on Meta::CPAN

    $self -> AddTag ('option', ['value'], undef, ['selected'],
                { 
                perlcode =>
                    [ 
                    '_ep_opt (%$n%, $_ep_selectname, %&*\'value%, %&\'selected%);',
                    '_ep_opt (%$n%, $_ep_selectname, %>*\'1%, %&\'selected%);',
                    #'_ep_opt (%$n%, %^*htmlselect%, %&*\'value%, %&\'selected%);',
                    #'_ep_opt (%$n%, %^*htmlselect%, %>*\'1%, %&\'selected%);',
                    ]
                },
                { 'nodename' => ':<:>:option:', 'cdatatype' => ntypAttrValue, procinfo => {} }) ;

    $self -> AddTagWithStart ('/option', 'option', undef, undef, undef, undef,
                               { 'nodename' => ':</:>:option:', 'cdatatype' => ntypAttrValue, procinfo => {} } ) ;

    $self -> AddTag ('a', undef, ['href'], undef, undef, { 'nodename' => ':<:>:a:', 'cdatatype' => ntypAttrValue, procinfo => {} }, 1) ;
    $self -> AddTag ('area', undef, ['href'], undef, undef, undef, 1) ;
    $self -> AddTag ('frame', undef, ['src'], undef, undef, undef, 1) ; 
    $self -> AddTag ('iframe', undef, ['src'], undef, undef, undef, 1) ; 
    $self -> AddTag ('embed', undef, ['src'], undef, undef) ; 
    $self -> AddTag ('layer', undef, ['src'], undef, undef) ; 
    $self -> AddTag ('img', undef, ['src'], undef, undef) ; 
    $self -> AddTag ('form', undef, ['action'], undef, undef, { 'nodename' => ':<:>:form:', 'cdatatype' => ntypAttrValue, procinfo => {} }, 2) ; 
    
    }






1;

Embperl/Syntax/HTML.pm  view on Meta::CPAN

                                'unescape'  => 1,
                                (ref($taginfo) eq 'HASH'?%$taginfo:()),
                              } ;
    $tag -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo, (ref($taginfo) eq 'HASH'?%{$taginfo->{procinfo}}:()) } if ($procinfo) ;

    my %inside = (%{$self -> {-htmlQuotes}},
                   'removeslash' =>
        {
        'text' => "/",
        'nodetype' => 0,
        'cdatatype' => 0,
        'removespaces' => 0,
        'nodename' => '',
        },

                 ) ;
    my $addinside = 0 ;
    if ($attrs)
        {
        my $assignattr = $self -> {-htmlAssignAttr} ;
        foreach (@$attrs)

Embperl/Syntax/HTML.pm  view on Meta::CPAN

###################################################################################


%Attr = (
    '-lsearch' => 1,
    'Attribut ""' => 
        {
        'text'   => '"',
        'end'    => '"',
        'nodetype'   => ntypAttr,
        'cdatatype'  => ntypAttrValue,
        },
    'Attribut \'\'' => 
        {
        'text'   => '\'',
        'end'    => '\'',
        'nodetype'   => ntypAttr,
        'cdatatype'  => ntypAttrValue,
        'addflags' => aflgSingleQuote,
        },
    'Attribut alphanum' => 
        {
        'contains'   => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
        'nodetype'   => ntypAttr,
        'cdatatype'  => ntypAttrValue,
        }
    ) ;


%AssignAttr = (
    'Assign' => 
        {
        'text' => '=',
        'follow' => \%Attr,
        }
    ) ;

%Quotes = (
    'Quote ""' => 
        {
        'text'   => '"',
        'end'    => '"',
        'nodetype'   => ntypCDATA,
        'cdatatype'  => ntypAttrValue,
        },
    'Quote \'\'' => 
        {
        'text'   => '\'',
        'end'    => '\'',
        'nodetype'   => ntypCDATA,
        'cdatatype'  => ntypAttrValue,
        },
    ) ;


1;


__END__

=pod

Embperl/Syntax/POD.pm  view on Meta::CPAN

sub AddPODCmd

    {
    my ($self, $cmdname, $name) = @_ ;

    my $ttfollow = $self -> {-PODCmds} ;

    my $tag = $ttfollow -> {$cmdname} = { 
                                'text'      => $cmdname,
                                'nodetype'  => ntypStartEndTag,
                                'cdatatype' => ntypText,
                                'removespaces'  => 72,
                                'inside'  => \%Format,
                              } ;
    $tag -> {nodename} = $name if ($name) ;

    return $tag ;
    }


sub AddPODStartEnd

    {
    my ($self, $start, $end, $name) = @_ ;

    my $ttfollow = $self -> {-PODCmds} ;

    my $stag = $ttfollow -> {$start} = { 
                                'text'      => $start,
                                'nodetype'  => ntypStartTag,
                                'cdatatype' => 0,
                                'removespaces'  => 72,
                              } ;
    $stag -> {nodename} = $name if ($name) ;

    my $etag = $ttfollow -> {$end} = { 
                                'text'      => $end,
                                'nodetype'  => ntypEndTag,
                                'cdatatype' => 0,
                                'starttag'  => $start,
                                'removespaces'  => 72,
                              } ;
    return $stag ;
    }




###################################################################################

Embperl/Syntax/POD.pm  view on Meta::CPAN

                'text' => '|',
                'end' => '>',
                'donteat' => 2,
                'follow' => {
                    'Quote ""' => 
                        {
                        'text'   => '"',
                        'end'    => '"',
                        'nodename' => 'uri',
                        'nodetype'   => ntypAttr,
                        'cdatatype'  => ntypAttrValue,
                        'addflags' => aflgSingleQuote,
                        },
                    'Quote \'\'' => 
                        {
                        'text'   => '\'',
                        'end'    => '\'',
                        'nodename' => 'uri',
                        'nodetype'   => ntypAttr,
                        'cdatatype'  => ntypAttrValue,
                        'addflags' => aflgSingleQuote,
                        },
                    'all' => 
                        {
                        'matchall' => 1,
                        'nodename' => 'uri',
                        'nodetype'   => ntypAttr,
                        'cdatatype'  => ntypAttrValue,
                        'donteat' => 2,
                        'addflags' => aflgSingleQuote,
                        },
                    },
                },
            'Quote ""' => 
                {
                'text'   => '"',
                'end'    => '"',
                'nodetype' => 0,
                'cdatatype' => ntypText,
                },
            'Quote \'\'' => 
                {
                'text'   => '\'',
                'end'    => '\'',
                'nodetype' => 0,
                'cdatatype' => ntypText,
                },
            '|1' => 
                {
                'text' => '|',
                'end' => '>',
                'nodename' => 'uri',
                'nodetype'   => ntypAttr,
                'cdatatype'  => ntypAttrValue,
                'donteat' => 2,
                'addflags' => aflgSingleQuote,
                },

            },
        },
    'POD Format L 2' => {
	'text' => 'L<',
	'end'  => '>',
        'nodename' => 'xlink',
        'nodetype'  => ntypStartEndTag,
        },
    'POD Format #' => {
	'text' => '#<',
	'end'  => '>',
        'nodename' => 'id',
        'nodetype'   => ntypAttr,
        'cdatatype'  => ntypAttrValue,
        'removespaces' => 72,
        },
    'http link' => {
	'text' => 'http://',
        'nodename' => 'xlink',
        'nodetype'  => ntypStartEndTag,
        'contains'   => '/.-:~?&=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
        'cdatatype' => ntypText,
        'donteat'   => 1,
        },
    'https link' => {
	'text' => 'https://',
        'nodename' => 'xlink',
        'nodetype'  => ntypStartEndTag,
        'contains'   => '/.-:~?&=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
        'cdatatype' => ntypText,
        'donteat'   => 1,
        },
    'ftp link' => {
	'text' => 'ftp://',
        'nodename' => 'xlink',
        'nodetype'  => ntypStartEndTag,
        'contains'   => '/.-:~?&=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
        'cdatatype' => ntypText,
        'donteat'   => 1,
        },
    ) ;

my $paraend = "\n\n" ;

%List = 
    (
    '-lsearch' => 1,
    '-defnodetype' => ntypText,
    'liststart' => {
        'text'      => '=over',
        'end'       => '=back',
        'nodetype'  => ntypStartEndTag,
        'cdatatype' => 0,
        'removespaces'  => 2,
        'nodename'    => 'list',
        'inside'     => \%List,
        },
    'listend' => { 
        'text'      => '=back',
        'end'       => "\n",
        'nodetype'  => ntypEndTag,
        'cdatatype' => 0,
        'nodename'  => 'list',
        'removespaces'  => 72,
        'exitinside' => 1,
        },
    'item*' => {
        'text'      => '=item *',
        'end'       => '=item *',
        'donteat'   => 2,
        'nodetype'  => ntypStartEndTag,
        'nodename' => 'item',

Embperl/Syntax/POD.pm  view on Meta::CPAN

    ) ;

%ListStart = 
    (
    %List,
    'title' => 
        {
        'matchall'  => -1,  # only match first time after =over
        'text' => "\x02",      # gives sort order
        'end' => "\n",      # eat until end of line
        'cdatatype' => 0,
        'nodetype'  => 0,
        },
    ) ;

%CDATA = 
    (
    '-lsearch' => 1,
    'http link' => {
	'text' => 'http://',
        'nodename' => 'xlink',
        'nodetype'  => ntypStartEndTag,
        'contains'   => '/.-:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
        'cdatatype' => ntypText,
        'donteat'   => 1,
        },
    'ftp link' => {
	'text' => 'ftp://',
        'nodename' => 'xlink',
        'nodetype'  => ntypStartEndTag,
        'contains'   => '/.-:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
        'cdatatype' => ntypText,
        'donteat'   => 1,
        },
    'verbatim2' => 
        {
        'text' => " ",
        'end' => $paraend,
        'cdatatype' => ntypCDATA,
        'nodename' => ':::<![CDATA[:]]>',
        'removespaces' => 0,
        #'inside'  => { 'X' => { removespaces => 0, cdatatype => ntypCDATA }},
        #'inside' => \%Format,
        'nodetype'  => ntypStartEndTag,
        'donteat'  => 3,
        },


    ) ;

%Skip =
    (
    'skip1' => 
        {
#        'text' => "\n",
        'contains' => "\r\n",
        'nodetype' => ntypTag,
        'cdatatype' => 0,
        'removespaces' => 0,
        'nodename' => "!:\n",
        },
#    'skip2' => 
#        {
#        'text' => "\r",
#        'contains' => "\r\n",
#        'nodetype' => ntypTag,
#        'cdatatype' => 0,
#        'removespaces' => 0,
#        'nodename' => "!:\n",
#        },
    ) ;


%Para = 
    (
    %List,
    'skip' => 
        {
        'text' => "\n",
        'nodetype' => 0,
        'cdatatype' => 0,
        'removespaces' => 0,
        'nodename' => "\n",
        },
    'skip2' => 
        {
        'text' => "\r",
        'nodetype' => 0,
        'cdatatype' => 0,
        'removespaces' => 0,
        'nodename' => '',
        },
    'para' => 
        {
        'matchall'      => 1,
        'text' => "\0x01", # gives sort order
        'end' => $paraend,
        'cdatatype' => ntypText,
        'nodename' => 'para',
        'removespaces' => 72,
        'inside' => \%Format,
        'nodetype'  => ntypStartEndTag,
        },
    'verbatim' => 
        {
        'text' => " ",
        'end' => $paraend,
        'cdatatype' => 0,
        'nodename' => 'verbatim',
        'removespaces' => 0,
        'inside' => \%CDATA,
        'nodetype'  => ntypStartEndTag,
        'donteat'  => 1,
        },
    'pic' => {
        'text'      => '=pic',
        'end' => $paraend,
        'nodename'  => 'pic',
        'nodetype'  => ntypStartEndTag,
        'cdatatype' => ntypText,
        },
    #%Skip,
    ) ;

%ParaTitle = 
    (
    'title' => 
        {
        'matchall'  => -1,  # only match first time after =head
        'text' => "\x02",      # gives sort order
        'end' => $paraend,
        'cdatatype' => ntypText,
        'nodename' => 'title',
        'removespaces' => 40, #72,
        'inside' => \%Format,
        'nodetype'  => ntypStartEndTag,
        },
    %Para,
    ) ;

%ParaItem = 
    (
    %Para,
    'itemtext' => 
        {
        'matchall'  => -1,  # only match first time after =head
        'text' => "\x02",      # gives sort order
        'end' => $paraend,
        'cdatatype' => ntypText,
        'nodename' => 'itemtext',
        'removespaces' => 72,
        'inside' => \%Format,
        'nodetype'  => ntypStartEndTag,
        },
    'item*' => {
        'text'      => '=item *',
        'nodename'  => 'item',
        'nodetype'  => ntypEndTag,
        'donteat'   => 1,

Embperl/Syntax/POD.pm  view on Meta::CPAN

    'listend' => {
        'text'      => '=back',
        'nodename'  => 'item',
        'nodetype'  => ntypEndTag,
        'donteat'   => 1,
        'exitinside'  => 1,
        },
    'cut' => {
        'text'      => '=cut',
        'nodetype'  => 0,
        'cdatatype'  => 0,
        'nodename' => '',
        'inside'  => \%SearchInside,
        },
    
    
    ) ;

%SearchInside = 
    (
    '-lsearch' => 1,
    '-defnodetype' => 0,
    'start' => {
        'text'      => "\n=",
        'donteat'   => 1,
        'nodetype'  => 0,
        'cdatatype'  => 0,
        'removespaces' => 2,
        'exitinside'  => 1,
        },
    ) ;


%Tags = 
    (
    '-lsearch' => 1,
    '-defnodetype' => ntypText,

Embperl/Syntax/POD.pm  view on Meta::CPAN

        'nodetype'  => ntypStartEndTag,
        'nodename' => 'head',
        'removespaces' => 2,
        'inside'  => {
            '-lsearch' => 1,
            'title' => 
                {
                'matchall'  => -1,  # only match first time after =head
                'text' => "\x02",      # gives sort order
                'end' => $paraend,
                'cdatatype' => ntypText,
                'nodename' => 'title',
                'removespaces' => 72,
                'inside' => \%Format,
                'nodetype'  => ntypStartEndTag,
                },
            },
        },
    'head1' => {
        'text'      => '=head1',
        'end'       => '=head1',

Embperl/Syntax/POD.pm  view on Meta::CPAN

                'nodetype'  => ntypStartEndTag,
                'nodename' => 'sect2',
                'removespaces' => 2,
                'inside'  => {
                    '-lsearch' => 1,
                    %ParaTitle,
                    'head1' => {
                        'text'      => '=head1',
                        'nodename' => 'sect2',
                        'nodetype'  => ntypEndTag,
                        'cdatatype' => 0,
                        'donteat'   => 1,
                        'exitinside'  => 1,
                        },
                    'head2' => {
                        'text'      => '=head2',
                        'nodetype'  => ntypEndTag,
                        'nodename' => 'sect2',
                        'donteat'   => 1,
                        'exitinside'  => 1,
                        },
                    'cut' => {
                        'text'      => '=cut',
                        'nodetype'  => 0,
                        'cdatatype'  => 0,
                        'nodename' => '',
                        'inside'  => \%SearchInside,
                        },
                    'head3' => {
                        'text'      => '=head3',
                        'end'       => '=head3',
                        'donteat'   => 2,
                        'nodetype'  => ntypStartEndTag,
                        'nodename' => 'sect3',
                        'removespaces' => 2,
                        'inside'  => {
                            '-lsearch' => 1,
                            %ParaTitle,
                            'head1' => {
                                'text'      => '=head1',
                                'nodename' => 'sect3',
                                'nodetype'  => ntypEndTag,
                                'cdatatype' => 0,
                                'donteat'   => 1,
                                'exitinside'  => 1,
                                },
                            'head2' => {
                                'text'      => '=head2',
                                'nodetype'  => ntypEndTag,
                                'cdatatype' => 0,
                                'nodename' => 'sect3',
                                'donteat'   => 1,
                                'exitinside'  => 1,
                                },
                            'head3' => {
                                'text'      => '=head3',
                                'nodetype'  => ntypEndTag,
                                'nodename' => 'sect3',
                                'donteat'   => 1,
                                'exitinside'  => 1,
                                },
                            'cut' => {
                                'text'      => '=cut',
                                'nodetype'  => 0,
                                'cdatatype'  => 0,
                                'nodename' => '',
                                'inside'  => \%SearchInside,
                                },
                            },
                        },
                    },
                },
            },
        },
    'cut' => {
        'text'      => '=cut',
        'nodetype'  => 0,
        'cdatatype'  => 0,
        'exitinside'  => 1,
        },
#    %Para,
    ) ;

%Search = 
    (
    '-lsearch' => 1,
    '-defnodetype' => 0,
    '-rootnode' => 'pod',
    'start' => {
        'text'      => "\n=",
        'donteat'   => 1,
        'nodetype'  => 0,
        'cdatatype'  => 0,
        'removespaces' => 2,
        'inside'  => \%Tags
        },
    'startpod' => {
        'text'      => '=pod',
        'end'       => "\n",
        'nodetype'  => 0,
        'cdatatype'  => 0,
        'removespaces' => 2,
        'inside'  => \%Tags
        },
    'startpod2' => {
        'text'      => "\n=pod",
        'end'       => "\n",
        'nodetype'  => 0,
        'cdatatype'  => 0,
        'removespaces' => 2,
        'inside'  => \%Tags
        },
    ) ;

1;


__END__

Embperl/Syntax/RTF.pm  view on Meta::CPAN


    {
    my ($self, $cmdname, $procinfo, $taginfo, $procinfoinside) = @_ ;

    my $ttfollow = $self -> {-rtfCmds} ;

    my $tag = $ttfollow -> {$cmdname} = { 
                                'text'      => $cmdname,
                                'nodetype'  => ntypStartEndTag,
                                #'nodetype'  => ntypTag,
                                #'cdatatype' => ntypAttrValue,
                                'forcetype' => 1,
                                'unescape'  => 1,
                                'removespaces'  => 16,
                                (ref($taginfo) eq 'HASH'?%$taginfo:()),
                              } ;
    if ($procinfo) 
        {
        #$procinfo -> {compiletimeperlcode} = q[my $tmp = %#'0% ; $tmp =~ s/_ep_rp\(.*?\,/push \@_ep_rtf_tmp,(/,  $Embperl::req -> component -> code ($tmp) ; ] ;
        $tag -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo } ;
        }

Embperl/Syntax/RTF.pm  view on Meta::CPAN

    $self -> AddInitCode (undef, '$_ep_rtf_ndx=0;$escmode=0;sub esc { my $x = shift ; $x =~ s/([{}])/\\\\$1/g ; $x =~ s/\n/\\\\line /g ; $x} ; ', undef) ;

    $self -> AddRTFCmd ('DOCVARIABLE',
                            { 
                            perlcode => '_ep_rp(%$x%,scalar(esc(join(\'\',', 
                            perlcodeend => '))));', 
                            compiletimeperlcode => q[if ($_ep_rtf_inside) { my $tmp = $Embperl::req -> component -> code () ; $tmp =~ s/_ep_rp\(.*?\,/push \@_ep_rtf_tmp,(/ ; $Embperl::req -> component -> code ($tmp) } ; $_ep_rtf_cmd = 1 ;],
			    },
                            { 
                            'inside'    => \%Var,
                            'cdatatype' => 0,
                            },
                            ) ;
    $self -> AddRTFCmd ('MERGEFIELD',
                            { 
                            perlcode => '_ep_rp(%$x%,scalar(esc(join(\'\', ',
                            perlcodeend => '))));', 
                            compiletimeperlcode => q[if ($_ep_rtf_inside) { my $tmp = $Embperl::req -> component -> code () ; $tmp =~ s/_ep_rp\(.*?\,/push \@_ep_rtf_tmp,(/ ; $tmp .= '\'' . (%>'-1%) . '\'' . ',' ; $Embperl::req -> component -> code ($...
			    },
                            { 
                            'inside'    => \%Var,
                            'cdatatype' => 0,
			    },
                            ) ;


    $self -> AddRTFCmd ('NEXT',
                            { 
                            perlcode => '$_ep_rtf_ndx++;', 
                            'removenode'  => 1,
			    },
                            { 
                            'nodename' => '::::NEXT',
                            'cdatatype' => 0,
			    }) ;

    $self -> AddRTFCmd ('MERGEREC',
                            { 
                            perlcode => '_ep_rp(%$x%,$_ep_rtf_ndx+1);', 
			    },
                            { 
                            'nodename' => '::::MERGEREC',
                            'cdatatype' => 0,
			    },
                            { 
                            perlcode => 'push @_ep_rtf_tmp,$_ep_rtf_ndx+1', 
			    },
                            ) ;

    $self -> AddRTFCmd ('MERGESEQ',
                            { 
                            perlcode => '_ep_rp(%$x%,$_ep_rtf_ndx+1);', 
			    },
                            { 
                            'nodename' => '::::MERGESEQ',
                            'cdatatype' => 0,
			    },
                            { 
                            perlcode => 'push @_ep_rtf_tmp,$_ep_rtf_ndx+1', 
			    },
                            ) ;

    $self -> AddRTFCmd ('IF',
                            { 
                            perlcode => '@_ep_rtf_tmp=();%>\'-1% =~ /^\s*(.*?)\s*$/ ; $_ep_rtf_preif=$1;', 
                            compiletimeperlcode => q[$_ep_rtf_inside = 1 ; $_ep_rtf_code = '{ my $itmp = $true?$_ep_rtf_tmp[3]:$_ep_rtf_tmp[4]; _ep_rp($x, \'{\'.$_ep_rtf_preif.(($itmp =~ /^\\\\\\\\/) || !$_ep_rtf_preif?$itmp:" $itmp").\'}\');}'  ;  $...
                            'removenode'  => 1,
			    },
                            { 
                            'nodename' => '::::IF',
                            'cdatatype' => 0,
			    },
                            ) ;

    $self -> AddRTFCmd ('NEXTIF',
                            { 
                            perlcode => '@_ep_rtf_tmp=();', 
                            compiletimeperlcode => q[$_ep_rtf_inside = 1 ; $_ep_rtf_code = '$_ep_rtf_ndx++ if ($true); ' ;  $_ep_rtf_cmd = 1 ;],
                            'removenode'  => 1,
			    },
                            { 
                            'nodename' => '::::NEXTIF',
                            'cdatatype' => 0,
			    },
                            ) ;

    $self -> AddRTFCmd ('SKIPIF',
                            { 
                            perlcode => '@_ep_rtf_tmp=();', 
                            compiletimeperlcode => q[$_ep_rtf_inside = 1 ; $_ep_rtf_code = '$_ep_rtf_ndx+=2 if ($true); ' ;  $_ep_rtf_cmd = 1 ; ],
                            'removenode'  => 1,
			    },
                            { 
                            'nodename' => '::::NEXTIF',
                            'cdatatype' => 0,
			    },
                            ) ;
    }



sub Var2Code

    {
    my $var = shift ;

Embperl/Syntax/RTF.pm  view on Meta::CPAN


# Variablename inside of a command

%Var = (
    '-lsearch' => 1,
    'Varname' => 
        {
        'contains'   => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.\r\n",
        #'inside'     => \%Varseparator,
        #'inside'     => \%Varinside,
        'cdatatype' => ntypTag,
        'nodename'   => ':{:}:full_var',
        'procinfo'   => {
            'embperl' => {
                compiletimeperlcode => q[$Embperl::req -> component -> code (Embperl::Syntax::RTF::Var2Code (%#'0%)) ;],
                },
            },

        },
    'VarnameComment' => 
        {
        text => '\\\\*',
        'cdatatype' => 0,
        'contains'   => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.\r\n",
        },
    ) ;


%Inside = () ;


%ParaBlockInside = (
    '-lsearch' => 1,
    'RTF block' => {
	'text' => '{',
	'end'  => '}',
        'nodename' => '!:{:::}',
        'nodetype'  => ntypStartEndTag,
        'cdatatype' => ntypCDATA,
        'removespaces' => 0,
	'inside' => \%ParaBlockInside,
        'procinfo'   => {
            'embperl' => {
                },
            },
        },
    'RTF field' => {
	'text' => '{\field',
	'end'  => '}',
        'nodename' => '!:{:::}',
        'nodetype'  => ntypStartEndTag,
	#'cdatatype' => ntypAttrValue,
	'insidemustexist' => 1,
	'inside' => \%FieldStart,
        'procinfo'   => {
            'embperl' => {
                },
            },
        },
    ) ;


# Start of commands

%CmdStart = (
    '-lsearch' => 1,
    'RTF block cmd'    => {
	'text'	   => '{',
	'end'	   => '}',
	'unescape' => 1,
        'nodetype'  => ntypStartEndTag,
        'removespaces' => 2,
        #'cdatatype' => ntypCDATA,
	#'cdatatype' => ntypAttrValue,
        'nodename' => '!:',
	'inside'  => {%ParaBlockInside,}, 
        'procinfo'   => {
            'embperl' => {
                compiletimeperlcodeend => q[ $Embperl::req -> component -> code ('') if (!$_ep_rtf_inside || $_ep_rtf_cmd) ; $_ep_rtf_cmd = 0 ;],
                perlcodeend => q[ { my $tmp = %#'0% ; if ($tmp =~ /\"\s*$/) { $tmp =~ s/\\\\/\\\\\\\\/g ; push @_ep_rtf_tmp, Text::ParseWords::quotewords('\s+', 0, $tmp) } else { push @_ep_rtf_tmp,$tmp } }], 
                },
            },
#        'procinfo'   => {'embperl' => {}},
        },

Embperl/Syntax/RTF.pm  view on Meta::CPAN


# Field start and end

%FieldStart = (
    '-lsearch' => 1,
    'RTF block inside'    => {
	'text' => '{',
	'end'  => '}',
        'nodename' => '!:{:::}',
        'nodetype'  => ntypStartEndTag,
        'cdatatype' => ntypCDATA,
        'removespaces' => 0,
	'inside' => \%Block,
        },
    'RTF fieldstart' => {
	'text'	   => '{\*\fldinst',
	'end'	   => '}',
        'nodename' => '!:',
        'nodetype'  => ntypStartEndTag,
        #'cdatatype' => ntypCDATA,
	#'cdatatype' => ntypAttrValue,
	'inside'  => \%CmdStart,
        'procinfo'   => {'embperl' => {}},
        },
    'RTF fieldend' => {
	'text'	   => '{\fldrslt',
	'end'	   => '}',
        'nodename' => '!',
	'cdatatype' => ntypAttrValue,
	'inside'  => \%BlockInside,
        },
    ) ;


=pod

=begin comment

    'RTF first paragraph' => {

Embperl/Syntax/RTF.pm  view on Meta::CPAN


# Finds the first paragraph

%Para = (
    '-lsearch' => 1,
    'RTF field' => {
	'text' => '{\field',
	'end'  => '}',
        'nodename' => '!:{:::}',
        'nodetype'  => ntypStartEndTag,
	#'cdatatype' => ntypAttrValue,
	'insidemustexist' => 1,
	'inside' => \%FieldStart,
        'procinfo'   => {
            'embperl' => {
                },
            },
        },
    %ParaBlockInside,
    ) ;

%RTF = (
    '-lsearch' => 1,
    'RTF mainblock' => {
	'text' => '{\rtf1',
	'end'  => '}',
        'nodename' => '!:{\rtf1:::}',
        'nodetype'  => ntypStartEndTag,
        'cdatatype' => ntypCDATA,
        'removespaces' => 0,
	'inside' => \%Block,
        'procinfo'   => {
            'embperl' => {
                perlcode => q[ my @_ep_rtf_stack ; do { ],
                perlcodeend => q[ $_ep_rtf_ndx++;} while ($param[$_ep_rtf_ndx]) ; ],
                mayjump => 1,
                },
            },
        },

Embperl/Syntax/RTF.pm  view on Meta::CPAN

#print "---------\n" ;
#foreach (@_ep_rtf_tmp) { print "<$_>\n" ; } ;                                                 


%Block = (
    '-lsearch' => 1,
#    'RTF block' => {
#	'text' => '{',
#	'end'  => '}',
#        'nodename' => '!:{:}:',
#	'cdatatype' => ntypAttrValue,
#	#'forcetype' => ntypAttrValue,
#        'removespaces' => 0,
#	'inside' => \%Block,
#        },
    'RTF block' => {
	'text' => '{',
	'end'  => '}',
        'nodename' => '!:{:::}',
        'nodetype'  => ntypStartEndTag,
        'cdatatype' => ntypCDATA,
        'removespaces' => 0,
	'inside' => \%Block,
        'procinfo'   => {
            'embperl' => {},
                },
        },
    'RTF field' => {
	'text' => '{\field',
	'end'  => '}',
        'nodename' => '!:{:::}',

Embperl/Syntax/RTF.pm  view on Meta::CPAN

    ) ;

# Block inside of a command that should be deleted in the output

%BlockInside = (
    '-lsearch' => 1,
    'RTF block' => {
	'text' => '{',
	'end'  => '}',
        'nodename' => '!',
	'cdatatype' => ntypAttrValue,
	'inside' => \%BlockInside,
        },
    ) ;


1;
=pod

=begin comment

epdom.c  view on Meta::CPAN

		{
		int i ;

		for (i = 0; i < nTextLen; i++)
		    {
		    if (!isspace (sText[i]))
			break ;
		    }
		
		if (i == nTextLen)
		    return 1 ; /* do not add only spaces as cdata inside a tag */
		}

	    pNew = ((tAttrData *)(pParent + 1)) + pParent -> numAttr - 1 ; /* get last attribute of node */
	    if (pParent -> numAttr == 0 || pNew -> xName != xNoName || bForceAttrValue > 1)
		{ /* --- add dummy attribute --- */
		if (!(xParent = Node_appendChild (a, pDomTree, xParent, nRepeatLevel, ntypAttr, 0, NULL, xNoName, nLevel, nLinenumber, "<noname>")))
		    return 0 ;
		nLevel++ ;
		pNew = Attr_self (pDomTree, xParent) ;  
                }

epdom.c  view on Meta::CPAN

    return pNewNode -> xNdx ;
    }



    
/* ------------------------------------------------------------------------ */
/*                                                                          */
/* Node_insertAfter_CDATA                                                   */
/*                                                                          */
/* Inserts a cdata after another node                                       */
/*                                                                          */
/* ------------------------------------------------------------------------ */

tNode Node_insertAfter_CDATA    (/*in*/ tApp * a, 
                                 /*in*/ const char *    sText,
				 /*in*/ int             nTextLen,
			         /*in*/ int		nEscMode,
                                 /*in*/ tDomTree *      pRefNodeDomTree,
				 /*in*/ tNode		xRefNode,
                                 /*in*/ tRepeatLevel    nRefRepeatLevel)

epparse.c  view on Meta::CPAN

        
	    p = &pTable[n] ;
	    p -> sName     = pKey ;
	    p -> sText     = GetHashValueStrDup (aTHX_ r -> pThread -> pMainPool, pHash, "text", "") ;
            p -> nTextLen  = p -> sText?strlen (p -> sText):0 ;
	    p -> sEndText  = GetHashValueStrDup (aTHX_ r -> pThread -> pMainPool, pHash, "end", (char *)pDefEnd) ;
	    p -> sNodeName = GetHashValueStrDup (aTHX_ r -> pThread -> pMainPool, pHash, "nodename", NULL) ;
	    p -> nNodeType = (tNodeType)GetHashValueInt (aTHX_ pHash, "nodetype", ntypTag) ;
	    p -> bUnescape = GetHashValueInt (aTHX_ pHash, "unescape", 0) ;
	    p -> bAddFlags = GetHashValueInt (aTHX_ pHash, "addflags", 0) ;
	    p -> nCDataType = (tNodeType)GetHashValueInt (aTHX_ pHash, "cdatatype", pTokenTable -> nDefNodeType) ;
	    p -> nForceType = (tNodeType)GetHashValueInt (aTHX_ pHash, "forcetype", 0) ;
	    p -> bRemoveSpaces = GetHashValueInt (aTHX_ pHash, "removespaces", p -> nNodeType != ntypCDATA?2:0) ;
	    p -> bInsideMustExist = GetHashValueInt (aTHX_ pHash, "insidemustexist", 0) ;
	    p -> bMatchAll = GetHashValueInt (aTHX_ pHash, "matchall", 0) ;
	    p -> bDontEat  = GetHashValueInt (aTHX_ pHash, "donteat", 0) ;
	    p -> bExitInside= GetHashValueInt (aTHX_ pHash, "exitinside", 0) ;
	    p -> bAddFirstChild = GetHashValueInt (aTHX_ pHash, "addfirstchild", 0) ;
	    p -> pStartTag  = (struct tToken *)GetHashValueStrDup (aTHX_ r -> pThread -> pMainPool, pHash, "starttag", NULL) ;
	    p -> pEndTag    = (struct tToken *)GetHashValueStrDup (aTHX_ r -> pThread -> pMainPool, pHash, "endtag", NULL) ;
	    p -> sParseTimePerlCode =  GetHashValueStrDup (aTHX_ r -> pThread -> pMainPool, pHash, "parsetimeperlcode", NULL) ;

epparse.c  view on Meta::CPAN

        
	        while (*c)
		    {
		    pAllChars [tolower(*c) >> 3] |= 1 << (tolower(*c) & 7) ;
		    pAllChars [toupper(*c) >> 3] |= 1 << (toupper(*c) & 7) ;
		    c++ ;
		    }
                }	    

	    if (r -> Component.Config.bDebug & dbgBuildToken)
                lprintf (r -> pApp,  "[%d]TOKEN: %*c%s ... %s  unesc=%d nodetype=%d, cdatatype=%d, nodename=%s contains='%s' addfirstchild=%d\n", r -> pThread -> nPid, nLevel*2, ' ', p -> sText, p -> sEndText, p -> bUnescape, p -> nNodeType, p -> nCD...
        
	    if (p -> sNodeName)
		{
		if (p -> sNodeName[0] != '!')
		    p -> nNodeName = String2Ndx (r -> pApp, p -> sNodeName, strlen (p -> sNodeName)) ;
		else
		    p -> nNodeName = String2UniqueNdx (r -> pApp, p -> sNodeName + 1, strlen (p -> sNodeName + 1)) ;
		}
	    else
		p -> nNodeName = String2Ndx (r -> pApp, p -> sText, strlen (p -> sText)) ;

epparse.c  view on Meta::CPAN

		    }
		else
		    {
		    if (pToken -> nNodeType == ntypEndStartTag && level > 0)
			{
			xParentNode = Node_parentNode  (r -> pApp, pDomTree, xParentNode, 0) ;
			level-- ;
			}
		    if ((pToken -> nNodeType && pToken -> nNodeType != ntypCDATA) || pToken -> sNodeName)
			{
			/* add token as node if not cdata*/
			tNodeType nType = pToken -> nNodeType ;
			if (nType == ntypStartEndTag)
			    nType = ntypStartTag ;

			if (!(xNewNode = Node_appendChild (r -> pApp, pDomTree, xParentNode, 0, nType, (nCDataType == ntypAttrValue && pToken -> nNodeType != ntypAttr)?(pToken -> nForceType?2:1):0, NULL, nNodeName, level, GetLineNoOf (r, pCurrTokenStart), pToken -> sText...
			    {
			    r -> Component.pCurrPos = pCurrTokenStart ;

			    return rc ;
			    }

epparse.c  view on Meta::CPAN

	    		    pCurr  = pCurrTokenStart  ;
			    */
			    if (xNewNode != xParentNode)
				{
				Node_removeChild (r -> pApp, pDomTree, xParentNode, xNewNode, 0) ; 
				if (r -> Component.Config.bDebug & dbgParse)
				    lprintf (r -> pApp,  "[%d]PARSE: DelNode: +%02d %*s parent=%d node=%d\n", 
	                             r -> pThread -> nPid, level, level * 2, "", xParentNode, xNewNode) ; 
				}
				
			    /* add as cdata*/
			    if (!(xNewNode = Node_appendChild (r -> pApp, pDomTree, xParentNode, 0, (tNodeType)pTokenTable -> nDefNodeType, 0, pCurrStart, pCurr - pCurrStart, level, GetLineNoOf (r, pCurrStart), NULL)))
				return 1 ;
			    }
			else if (rc != rcTokenNotFound)
                            {
                            return rc ;
                            }
			 if (pToken -> nNodeType == ntypStartEndTag)
			    {
			    xParentNode = Node_parentNode  (r -> pApp, pDomTree, xNewNode, 0) ;



( run in 0.420 second using v1.01-cache-2.11-cpan-454fe037f31 )