You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2001/11/20 16:15:42 UTC

cvs commit: embperl/test/html tagintag.htm

richter     01/11/20 07:15:42

  Modified:    .        Tag: Embperl2c Changes.pod Embperl.pm MANIFEST
                        MANIFEST.2 README README.v2 test.pl
               Embperl  Tag: Embperl2c Recipe.pm
               Embperl/Syntax Tag: Embperl2c HTML.pm SSI.pm
  Added:       Embperl/Syntax Tag: Embperl2c Test.pm
               test/cmp Tag: Embperl2c tagintag.htm
               test/html Tag: Embperl2c tagintag.htm
  Log:
  2.0b4
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.129.4.36 +6 -2      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.129.4.35
  retrieving revision 1.129.4.36
  diff -u -r1.129.4.35 -r1.129.4.36
  --- Changes.pod	2001/11/16 14:06:11	1.129.4.35
  +++ Changes.pod	2001/11/20 15:15:41	1.129.4.36
  @@ -1,6 +1,6 @@
   =pod
   
  -=head1 2.0b4 (BETA) 
  +=head1 2.0b4 (BETA) 20. Nov. 2001
   
      - Enhancements for RTF syntax, allowing no IF fields and passes
        thru any unkown fields.
  @@ -30,7 +30,11 @@
      - print OUT inside loop works now correctly      
      - Added new escmode 8/15 which generates correct XML escaping. 
      - $row_foo will no longer treated as $row. Bug reported by Dave Fischer. 
  -
  +   - Add patch from Wim Kerkhoff so SSI syntax works together with 
  +     EmbperlObject, i.e. included files are searched in the same way as
  +     normal Embperl files.
  +   - Add new method AddTagInside in HTML::Embperl::Syntax::HTML to allow
  +     tags inside of other tags.
   
   =head1 2.0b3 (BETA) 9. July 2001
   
  
  
  
  1.118.4.62 +2 -2      embperl/Embperl.pm
  
  Index: Embperl.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.pm,v
  retrieving revision 1.118.4.61
  retrieving revision 1.118.4.62
  diff -u -r1.118.4.61 -r1.118.4.62
  --- Embperl.pm	2001/11/16 14:06:11	1.118.4.61
  +++ Embperl.pm	2001/11/20 15:15:41	1.118.4.62
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Embperl.pm,v 1.118.4.61 2001/11/16 14:06:11 richter Exp $
  +#   $Id: Embperl.pm,v 1.118.4.62 2001/11/20 15:15:41 richter Exp $
   #
   ###################################################################################
   
  @@ -69,7 +69,7 @@
   
   
   ##ep2##
  -$VERSION = '2.0b4_dev-6' ;
  +$VERSION = '2.0b4' ;
   ##/ep2##
   ##ep1##$VERSION = '1.3.4_dev';
   
  
  
  
  1.50.4.37 +3 -0      embperl/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /home/cvs/embperl/MANIFEST,v
  retrieving revision 1.50.4.36
  retrieving revision 1.50.4.37
  diff -u -r1.50.4.36 -r1.50.4.37
  --- MANIFEST	2001/11/16 12:43:37	1.50.4.36
  +++ MANIFEST	2001/11/20 15:15:41	1.50.4.37
  @@ -18,6 +18,7 @@
   Embperl/Syntax/Mail.pm
   Embperl/Syntax/RTF.pm
   Embperl/Syntax/POD.pm
  +Embperl/Syntax/Test.pm
   Embperl/Recipe.pm
   Embperl/Recipe/Embperl.pm
   Embperl/Recipe/EmbperlXSLT.pm
  @@ -87,6 +88,8 @@
   test/html/pod/pod.asc
   test/html/incxmlLibXSLT.htm
   test/html/incxmlXalanXSLT.htm
  +test/html/tagintag.htm
  +test/cmp/tagintag.htm
   test/cmp/pod.asc
   test/cmp/pod.xml
   test/cmp/pod.xml.xalan
  
  
  
  1.1.2.24  +3 -0      embperl/Attic/MANIFEST.2
  
  Index: MANIFEST.2
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/MANIFEST.2,v
  retrieving revision 1.1.2.23
  retrieving revision 1.1.2.24
  diff -u -r1.1.2.23 -r1.1.2.24
  --- MANIFEST.2	2001/11/16 12:43:37	1.1.2.23
  +++ MANIFEST.2	2001/11/20 15:15:41	1.1.2.24
  @@ -18,6 +18,7 @@
   Embperl/Syntax/Mail.pm
   Embperl/Syntax/RTF.pm
   Embperl/Syntax/POD.pm
  +Embperl/Syntax/Test.pm
   Embperl/Recipe.pm
   Embperl/Recipe/Embperl.pm
   Embperl/Recipe/EmbperlXSLT.pm
  @@ -85,6 +86,8 @@
   test/html/pod/pod.asc
   test/html/incxmlLibXSLT.htm
   test/html/incxmlXalanXSLT.htm
  +test/html/tagintag.htm
  +test/cmp/tagintag.htm
   test/cmp/pod.asc
   test/cmp/pod.xml
   test/cmp/pod.xml.xalan
  
  
  
  1.19.6.12 +3 -3      embperl/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/embperl/README,v
  retrieving revision 1.19.6.11
  retrieving revision 1.19.6.12
  diff -u -r1.19.6.11 -r1.19.6.12
  --- README	2001/09/13 07:31:18	1.19.6.11
  +++ README	2001/11/20 15:15:41	1.19.6.12
  @@ -9,16 +9,16 @@
   WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
   MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   
  -$Id: README,v 1.19.6.11 2001/09/13 07:31:18 richter Exp $
  +$Id: README,v 1.19.6.12 2001/11/20 15:15:41 richter Exp $
   
   
   ### !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! 
   ###
   ###
  -### This is the third BETA release of Embperl 2.0, before installing
  +### This is the fours BETA release of Embperl 2.0, before installing
   ### please read the README.v2. Documentation is not yet updated to
   ### reflect the changes in 2.0, everything that has changed is
  -### documented in README.v2. Since the first and second beta I have fixed a lot
  +### documented in README.v2. Since the last betas I have fixed a lot
   ### of smaller bugs and use it now in production environment on my own.
   ### But be carefull this release may still contain bugs.
   ###
  
  
  
  1.1.4.20  +2 -2      embperl/Attic/README.v2
  
  Index: README.v2
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/README.v2,v
  retrieving revision 1.1.4.19
  retrieving revision 1.1.4.20
  diff -u -r1.1.4.19 -r1.1.4.20
  --- README.v2	2001/11/16 13:15:18	1.1.4.19
  +++ README.v2	2001/11/20 15:15:41	1.1.4.20
  @@ -9,7 +9,7 @@
   WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
   MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   
  -$Id: README.v2,v 1.1.4.19 2001/11/16 13:15:18 richter Exp $
  +$Id: README.v2,v 1.1.4.20 2001/11/20 15:15:41 richter Exp $
   
   
   ### !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! 
  @@ -18,7 +18,7 @@
   ### This is the fours BETA release of Embperl 2.0, before installing
   ### please read the README.v2. Documentation is not yet updated to
   ### reflect the changes in 2.0, everything that has changed is
  -### documented in README.v2. Since the first and second beta I have fixed a lot
  +### documented in README.v2. Since the last beta I have fixed a lot
   ### of smaller bugs and use it now in production environment on my own.
   ### But be carefull this release may still contain bugs.
   ###
  
  
  
  1.70.4.96 +4 -1      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.70.4.95
  retrieving revision 1.70.4.96
  diff -u -r1.70.4.95 -r1.70.4.96
  --- test.pl	2001/11/16 13:15:18	1.70.4.95
  +++ test.pl	2001/11/20 15:15:41	1.70.4.96
  @@ -11,7 +11,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: test.pl,v 1.70.4.95 2001/11/16 13:15:18 richter Exp $
  +#   $Id: test.pl,v 1.70.4.96 2001/11/20 15:15:41 richter Exp $
   #
   ###################################################################################
   
  @@ -670,6 +670,9 @@
       'syntax.htm' => { 
           'version'    => 2,
           'repeat'     => 2,
  +        },
  +    'tagintag.htm' => { 
  +        'version'    => 2,
           },
       'rtf/rtfbasic.asc' => { 
           'version'    => 2,
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +4 -3      embperl/Embperl/Attic/Recipe.pm
  
  Index: Recipe.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Recipe.pm,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- Recipe.pm	2001/11/16 13:15:18	1.1.2.6
  +++ Recipe.pm	2001/11/20 15:15:42	1.1.2.7
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Recipe.pm,v 1.1.2.6 2001/11/16 13:15:18 richter Exp $
  +#   $Id: Recipe.pm,v 1.1.2.7 2001/11/20 15:15:42 richter Exp $
   #
   ###################################################################################
    
  @@ -99,9 +99,10 @@
   
   =head1 DESCRIPTION
   
  -HTML::Embperl::Recipe provides basic feature for createing your own recipes.
  -To do so you have to create a class that provides a new method which returns
  -a hash that provides the description what to do as hash.
  +HTML::Embperl::Recipe provides basic features that are necessary for createing 
  +your own recipes.
  +To do so you have to create a class that provides a C<new> method which returns
  +a hash that contains the description what to do.
   
   =head2 new ($class, $r, $recipe, $param)
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.14  +104 -1    embperl/Embperl/Syntax/Attic/HTML.pm
  
  Index: HTML.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/HTML.pm,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- HTML.pm	2001/05/04 06:08:14	1.1.2.13
  +++ HTML.pm	2001/11/20 15:15:42	1.1.2.14
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: HTML.pm,v 1.1.2.13 2001/05/04 06:08:14 richter Exp $
  +#   $Id: HTML.pm,v 1.1.2.14 2001/11/20 15:15:42 richter Exp $
   #
   ###################################################################################
    
  @@ -113,6 +113,12 @@
           }
       $tag -> {'inside'} = \%inside if ($addinside) ;
   
  +    if (exists ($tag -> {'inside'}))
  +        {
  +        $self -> {-htmlTagInside} ||= [] ;
  +        push @{$self -> {-htmlTagInside}}, $tag -> {'inside'} ;
  +        }
  +
       return $tag ;
       }
   
  @@ -141,6 +147,97 @@
       }
   
   
  +
  +# ---------------------------------------------------------------------------------
  +#
  +#   Add new simple html tag which is also available inside of other tags
  +#
  +# ---------------------------------------------------------------------------------
  +
  +
  +sub AddTagInside
  +
  +    {
  +    my $self = shift ;
  +
  +    my $tag = $self -> AddTag (@_) ;
  +    
  +
  +    foreach my $inside (@{$self -> {-htmlTagInside}})
  +        {
  +        if (!exists ($inside -> {'HTML Tag'}))
  +            {
  +            $inside -> {'HTML Tag'} = 
  +                           {
  +                            'text' => '<',
  +                            'end'  => '>',
  +                            'follow' => {},
  +                            } ;
  +            }
  +        $inside -> {'HTML Tag'}{follow}{$_[0]} = $tag ;
  +        }
  +
  +    my $quotes = $self -> {"-htmlQuotes"} ;
  +    while (my ($k2, $v2) = each %$quotes)
  +        {
  +        if (ref($v2) eq 'HASH')
  +	    {	  
  +            my $inside = $v2 -> {inside} ;
  +            if (!exists ($inside -> {'HTML Tag'}))
  +                {
  +                $inside -> {'HTML Tag'} = 
  +                               {
  +                                'text' => '<',
  +                                'end'  => '>',
  +                                'follow' => {},
  +                                } ;
  +                }
  +            $inside -> {'HTML Tag'}{follow}{$_[0]} = $tag ;
  +
  +	    }
  +        }
  +
  +    $quotes = $self -> {"-htmlAssignAttr"}{'Assign'}{follow} ;
  +    while (my ($k2, $v2) = each %$quotes)
  +        {
  +        if (ref($v2) eq 'HASH')
  +	    {	  
  +            my $inside = $v2 -> {inside} ;
  +            if (!exists ($inside -> {'HTML Tag'}))
  +                {
  +                $inside -> {'HTML Tag'} = 
  +                               {
  +                                'text' => '<',
  +                                'end'  => '>',
  +                                'follow' => {},
  +                                } ;
  +                }
  +            $inside -> {'HTML Tag'}{follow}{$_[0]} = $tag ;
  +
  +	    }
  +        }
  +    $quotes = $self -> {"-htmlAssignAttrLink"}{'Assign'}{follow} ;
  +    while (my ($k2, $v2) = each %$quotes)
  +        {
  +        if (ref($v2) eq 'HASH')
  +	    {	  
  +            my $inside = $v2 -> {inside} ;
  +            if (!exists ($inside -> {'HTML Tag'}))
  +                {
  +                $inside -> {'HTML Tag'} = 
  +                               {
  +                                'text' => '<',
  +                                'end'  => '>',
  +                                'follow' => {},
  +                                } ;
  +                }
  +            $inside -> {'HTML Tag'}{follow}{$_[0]} = $tag ;
  +
  +	    }
  +        }
  +    }
  +
  +
   # ---------------------------------------------------------------------------------
   #
   #   Add new html comment tag
  @@ -352,6 +449,12 @@
   Processor info. See I<HTML::Embperl::Syntax> for a definition of procinfo.
   
   =back
  +
  +=head2 AddTagInside ($tagname, $attrs, $attrsurl, $attrsnoval, $procinfo)
  +
  +Same as AddTag, but tag could be also used inside of another tag. 
  +(e.g. <sometag <someothertag> > ). This is not HTML or XML compatible,
  +but maybe usefull for implementing tagslibs etc. sometimes.
   
   =head2 AddComment ($tagname, $attrs, $attrsurl, $attrsnoval, $procinfo)
   
  
  
  
  1.1.2.12  +42 -24    embperl/Embperl/Syntax/Attic/SSI.pm
  
  Index: SSI.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/SSI.pm,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- SSI.pm	2001/05/15 14:21:05	1.1.2.11
  +++ SSI.pm	2001/11/20 15:15:42	1.1.2.12
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: SSI.pm,v 1.1.2.11 2001/05/15 14:21:05 richter Exp $
  +#   $Id: SSI.pm,v 1.1.2.12 2001/11/20 15:15:42 richter Exp $
   #
   ###################################################################################
    
  @@ -222,9 +222,17 @@
   
       if (!defined ($apreq))
           {
  -        return $fn if ($fn) ;
  -        die "Cannot use 'virtual' without mod_perl" if ($virt) ;
  -        return $ENV{DOCUMENT_NAME} ;
  +        return $fn if ($fn);
  +        return $ENV{DOCUMENT_NAME} if (!$virt) ;
  +
  +	my $filename = $virt;
  +        
  +	#die "Cannot use 'virtual' without mod_perl" if ($virt) ;
  +
  +	if ($filename =~ /^\//) {
  +		$filename = $ENV{DOCUMENT_ROOT} . $filename;
  +	}
  +	return $filename;
           }
   
       if ($fn) 
  @@ -234,12 +242,12 @@
           }
       if ($virt) 
           {
  -        my $req = $apreq -> lookup_uri (InterpretVars ($fn)) ;
  +        my $req = $apreq -> lookup_uri (InterpretVars ($virt)) ;
           return $req -> filename ;
           }
       else
           {
  -        return $ENV{DOCUMENT_NAME} ;
  +        return $ENV{DOCUMENT_NAME} || $ENV{SCRIPT_FILENAME};
           }
       }
   
  @@ -323,22 +331,35 @@
   #   Include
   #
   # ---------------------------------------------------------------------------------
  -
  -sub include 
  -    {
  -    my($fn, $virt) = @_;
  -    
  -    my $file = find_file($fn, $virt) ;
  -    local $/ = undef ;
  -    local $HTML::Embperl::escmode = 0 ;
  -
  -    open FH, "<$file" or die "Cannot open $file ($!)" ;
  -    my $val = <FH> ;
  -    close FH ;
  -
  -    return $val ;
  -    }
   
  +sub include {
  +	my($fn, $virt) = @_;
  +				
  +	local $/ = undef ;
  +
  +	my $type = "SSI"; # adding Embperl to syntax results in errors I can't figure out...
  +	my $filename = $virt;
  +
  +	if ($fn) {
  +		$type = "Text";
  +		$filename = $fn;
  +	}
  +	elsif ($virt) {
  +		if ($filename =~ /^\//) {
  +			$filename = $ENV{DOCUMENT_ROOT} . "/$filename";
  +		}
  +	}
  +	else {
  +		warn "Nothing to #include... need file or virtual";
  +		return "";
  +	}
  +
  +	my $output = "";
  +	HTML::Embperl::Execute({inputfile=>$filename, output=>\$output, syntax=>$type});
  +
  +        local $HTML::Embperl::escmode = 0 ;
  +	return $output;
  +}
   
   # ---------------------------------------------------------------------------------
   #
  @@ -351,17 +372,14 @@
       {
       my($cmd, $cgi) = @_;
   
  -
       if (!defined (&Apache::request))
           {
           return scalar `$cmd` if ($cmd) ;
           die "Cannot use 'cgi' without mod_perl" ;
           }
   
  -
       my $r = $apreq ;
       my $filename = $r->filename;
  -
       
       die ("httpd: exec used but not allowed in $filename") if ($r->allow_options & &OPT_INCNOEXEC) ;
       
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +34 -0     embperl/Embperl/Syntax/Attic/Test.pm
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +23 -0     embperl/test/cmp/Attic/tagintag.htm
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +24 -0     embperl/test/html/Attic/tagintag.htm
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org