Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 40440 invoked from network); 23 Jan 2006 23:18:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jan 2006 23:18:49 -0000 Received: (qmail 34643 invoked by uid 500); 23 Jan 2006 23:18:48 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 34629 invoked by uid 500); 23 Jan 2006 23:18:47 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 34618 invoked by uid 99); 23 Jan 2006 23:18:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 15:18:47 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [81.0.228.129] (HELO ns.sofist.cz) (81.0.228.129) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 15:18:46 -0800 Received: (qmail 7949 invoked from network); 23 Jan 2006 23:35:41 +0100 Received: from localhost (127.0.0.1) by localhost with SMTP; 23 Jan 2006 23:35:41 +0100 Received: from ns.sofist.cz ([127.0.0.1]) by localhost (ns.sofist.cz [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 03931-20 for ; Mon, 23 Jan 2006 23:35:36 +0100 (CET) Received: (qmail 7940 invoked by uid 201); 23 Jan 2006 22:35:36 -0000 Received: from r3c210.chello.upc.cz (HELO ?192.168.1.9?) (213.220.194.210) by rumcajz.pcv.cz with SMTP; 23 Jan 2006 22:35:36 -0000 Message-ID: <43D56435.3090008@robert.cz> Date: Tue, 24 Jan 2006 00:18:13 +0100 From: RobertCZ User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gerald Richter CC: embperl@perl.apache.org Subject: Re: Redefining common tags? (partial solution) References: <20060123172205.8EC2F412421@lnx1.i.ecos.de> In-Reply-To: <20060123172205.8EC2F412421@lnx1.i.ecos.de> Content-Type: multipart/alternative; boundary="------------070807020603050500020500" X-Virus-Scanned: amavisd-new at ns.sofist.cz X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------070807020603050500020500 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Gerald Richter wrote: >Try > >$self -> AddTagBlock ('h2', undef, ['color'], undef, { perlcode => q{ > { local $escmode = 0; > _ep_rp(%$x%, " . $epreq -> Escape (%&'color%, 2) . "&text=" > . $epreq -> Escape (XML::Embperl::DOM::Node::iChildsText(%$n%), >2) > . "\">"); > }} > }) ; > > Excellent!!! It works! One more problem: the escaping ( initial local $escmode = 0 ) stops workins after first use and only is restore when some Embperl processed HTML is found eg

111


222


333


    444


    555


    results in
    <img src="/img/h2.png?color=&text=222">
    <img src="/img/h2.png?color=&text=333">

      <img src="/img/h2.png?color=&text=555">
      One more help, please... Thank you very much. - Robert >>3) it doesn't output outmost

      which is usefull for CSS >>styling, how can I add it so it down't go into endless loop? >> >> > >I don't understand the last question, could you give an example? > > I had problem when

      tag was replaced by

      and I supposed it dumps core because of some endless loop, but it was an unrelated problem. My mistake. --------------070807020603050500020500 Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Gerald Richter wrote:
      Try
      
      $self -> AddTagBlock ('h2', undef, ['color'], undef, { perlcode => q{
               { local $escmode = 0;
                   _ep_rp(%$x%, "<img src=\"/img/h2.gif?color=" 
                   . $epreq -> Escape (%&'color%, 2) . "&text="
                   . $epreq -> Escape (XML::Embperl::DOM::Node::iChildsText(%$n%),
      2)
                   . "\">");
               }}
           }) ;
        

      Excellent!!! It works!

      One more problem: the escaping ( initial local $escmode = 0 ) stops workins after first use and only is restore when some Embperl processed HTML is found eg

      <h2 color="#F00">111</h2><br>
      <h2>222</h2><br>
      <h2>333</h2><br>
      <ul></ul>
      <h2>444</h2><br>
      <h2>555</h2><br>

      results in

      <img src="/img/h2.png?color=%23F00&text=111"><br>
      &lt;img src=&quot;/img/h2.png?color=&amp;text=222&quot;&gt;<br>
      &lt;img src=&quot;/img/h2.png?color=&amp;text=333&quot;&gt;<br>
      <ul></ul>
      <img src="/img/h2.png?color=&text=444"><br>
      &lt;img src=&quot;/img/h2.png?color=&amp;text=555&quot;&gt;<br>

      One more help, please... Thank you very much.

      - Robert


      3) it doesn't output outmost <h2> which is usefull for CSS 
      styling, how can I add it so it down't go into endless loop?
          
      
      I don't understand the last question, could you give an example?
        

      I had problem when <h2> tag was replaced by <h2><stuff> and I supposed it dumps core because of some endless loop, but it was an unrelated problem. My mistake.


      --------------070807020603050500020500--