William McKee | 1 Mar 05:42
Favicon

Processing HTML

Hi Jean-Michel,

I'm working on writing some reviews about Petal for CPAN and a wiki that
I frequent[1]. In so doing, I was reading your Summary from the pod and
have a question about the following line:

  "Petal is a XML based templating engine that is able to process any
  kind of XML, XHTML and HTML."

Now, to my understanding, I'm under the impression that Petal cannot do
HTML without the help of HTML::TreeBuilder. This requires the use of
Petal::Parser::HTB, right? Should that line be rephrased or a footnote
added to explain how HTML is handled?

I cringe to bring up this issue since I know you're hesitant to continue
supporting Petal::Parser::HTB. Is anyone else on the list using a
version of Petal <2.00 or using the HTB parser with Petal 2+? I'm
slowing bringing some of my original websites up to well-formed XHTML
but haven't even switched my production server to 2.02 yet so am not
ready for losing access to HTB.

Thanks,
William

[1] http://cgi-app.org

--

-- 
Knowmad Services Inc.
http://www.knowmad.com

(Continue reading)

Jean-Michel Hiver | 1 Mar 15:08

Re: Processing HTML

William McKee wrote:

>Hi Jean-Michel,
>
>I'm working on writing some reviews about Petal for CPAN and a wiki that
>I frequent[1]. In so doing, I was reading your Summary from the pod and
>have a question about the following line:
>
>  "Petal is a XML based templating engine that is able to process any
>  kind of XML, XHTML and HTML."
>
>Now, to my understanding, I'm under the impression that Petal cannot do
>HTML without the help of HTML::TreeBuilder. This requires the use of
>Petal::Parser::HTB, right? Should that line be rephrased or a footnote
>added to explain how HTML is handled?
>  
>
I suppose this is deprecated. I'll have to update the docs.

I am really sorry I am unable to support the HTML parser as it should 
be. I would like to hightlight that:

* We do not use HTML anywhere in MKDoc, only XML / XHTML. Hence HTML is 
of no interest to me. It was just put there merely as a niceness / proof 
of concept of the multiple parsing backend functionality.

* I am in the process of re-factoring MKDoc into a bunch of modules and 
releasing them on CPAN, which simply takes enormous amounts of time.

* I have to do some paid work sometimes too, and there's only so many 
(Continue reading)

Michele Beltrame | 15 Mar 16:05

Problem with METAL syntax

Hi!

I'm having some problems using the METAL syntax. When I include a macro
from another file, it doesn't get correctly included in the first
occasion, but in subsequent others is is. For instance, I have the
following macro in frammenti.xhtml:

    <span metal:define-macro="titolo">
      La casa degli spiritosi
    </span>

I include it from the following file (I just report part of it here,
to make the message short):

    <p metal:use-macro="./frammenti.xhtml#titolo">
      Titolo
    </p>   
    <p metal:use-macro="./frammenti.xhtml#titolo">
      Titolo
    </p>   

The output is:

    <?include file="./frammenti.xhtml#titolo"?>
    <span>
      La casa degli spiritosi
    </span>

While I think the correct output should be:

(Continue reading)

Jean-Michel Hiver | 15 Mar 17:09

Petal::Parser::HTB 1.03

I have updated the test t/041_Entities.t in Petal::Parser::HTB as follows:

    like ($string, qr/\x{00a9}/ => 'Copyright');
    like ($string, qr/\x{00ae}/ => 'Registered');
    like ($string, qr/\x{00a0}/ => 'NBSP');

If this test passes on your system, the '&nbsp;' issue _should_ be no 
more - at least with a recent version of Perl.

Tested with Perl 5.8.3 with the latest HTML::Tree distro under Fedora 
Core 1.

Cheers,
Jean-Michel.

Jean-Michel Hiver | 15 Mar 17:25

Re: Problem with METAL syntax

Michele Beltrame wrote:

>Hi!
>
>I'm having some problems using the METAL syntax. When I include a macro
>from another file, it doesn't get correctly included in the first
>occasion, but in subsequent others is is. For instance, I have the
>following macro in frammenti.xhtml:
>
>    <span metal:define-macro="titolo">
>      La casa degli spiritosi
>    </span>
>
>I include it from the following file (I just report part of it here,
>to make the message short):
>
>    <p metal:use-macro="./frammenti.xhtml#titolo">
>      Titolo
>    </p>   
>    <p metal:use-macro="./frammenti.xhtml#titolo">
>      Titolo
>    </p>
>
>The output is:
>
>    <?include file="./frammenti.xhtml#titolo"?>
>    <span>
>      La casa degli spiritosi
>    </span>
>
(Continue reading)

William McKee | 16 Mar 15:42
Favicon

Re: Petal::Parser::HTB 1.03

On Mon, Mar 15, 2004 at 04:09:22PM +0000, Jean-Michel Hiver wrote:
> I have updated the test t/041_Entities.t in Petal::Parser::HTB as follows:
    <snip>
> If this test passes on your system, the '&nbsp;' issue _should_ be no 
> more - at least with a recent version of Perl.

Just installed Petal 2.03 and Petal::Parser::HTB 1.03. All tests are
passing for me now (that wasn't the case previously). The nbsp issue is
still present when using Petal::Parser::HTB unless I set the DocType and
the charset as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <rest of header info>

>From what I've read on the subject, these results make sense. I don't
see any reason to try to change Petal or Petal::Parser::HTB. I'm
migrating away from the need for HTB day-by-day.

> Tested with Perl 5.8.3 with the latest HTML::Tree distro under Fedora 
> Core 1.

Tested with Perl 5.8.3 under Debian 3.0 with Apache/1.3.29 (Unix)
mod_perl/1.29 mod_ssl/2.8.16 OpenSSL/0.9.6c.

Thanks,
William
(Continue reading)

Jean-Michel Hiver | 18 Mar 19:18

2.04 relased

Hi List,

There was a bug with attributes parsing in MKDoc::XML. This version adds 
a test which checks for this bug and updates dependency to MKDoc::XML 0.69.

Cheers,
Jean-Michel

William McKee | 23 Mar 03:35
Favicon

2.04 test failures

Hi Jean-Michel,

I recently upgraded a Debian server from Perl 5.6.1 to Perl 5.8.3. While
doing so, I installed the newest version of Petal 2.04. I got the
following two failure reports:

  t/065_HTML_Attribute_Strip....NOK 1#     Failed test (t/065_HTML_Attribute_Strip.t at line 15)
  #                   '<input onfocus="if(t.value='';" value=""></input>'
  #     doesn't match '(?-xism:test)'
  t/065_HTML_Attribute_Strip....NOK 2#     Failed test (t/065_HTML_Attribute_Strip.t at line 23)
  #                   '<input onfocus="if(t.value='';" value="" />'
  #     doesn't match '(?-xism:test)'
  # Looks like you failed 2 tests of 2.
  t/065_HTML_Attribute_Strip....dubious                                        
  	Test returned status 2 (wstat 512, 0x200)
  DIED. FAILED tests 1-2
  	Failed 2/2 tests, 0.00% okay
  Failed Test                  Stat Wstat Total Fail  Failed  List of Failed
  -------------------------------------------------------------------------------
  t/065_HTML_Attribute_Strip.t    2   512     2    2 100.00%  1-2
  Failed 1/56 test scripts, 98.21% okay. 2/240 subtests failed, 99.17% okay.

Let me know if I can do anything to help track down these failures. Is
there a way to get more verbose output when testing?

Thanks,
William

--

-- 
Knowmad Services Inc.
(Continue reading)

Michele Beltrame | 26 Mar 15:34
Gravatar

Re: 2.04 test failures

Hi!

> I recently upgraded a Debian server from Perl 5.6.1 to Perl 5.8.3. While
> doing so, I installed the newest version of Petal 2.04. I got the
> following two failure reports:
> 
>   t/065_HTML_Attribute_Strip....NOK 1#     Failed test (t/065_HTML_Attribute_Strip.t at line 15)
> [...]

I get exactly the same error installing on Perl 5.8.3 (I compiled the
interpreter myself on a Slackware 9.1). Petal 2.01 installed just fine.

	Michele.

--

-- 
Michele Beltrame
http://www.italpro.net/mb/
ICQ# 76660101 - e-mail: mb@...


Gmane