Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > HTML::Parser and <p> behaviour?

Reply
Thread Tools

HTML::Parser and <p> behaviour?

 
 
Tad McClellan
Guest
Posts: n/a
 
      10-14-2004
187 <(E-Mail Removed)> wrote:
> A. Sinan Unur wrote:
>> Geoff Cox <(E-Mail Removed)> wrote in
>> news:(E-Mail Removed):
>>
>>> I cannot seem to work out how HTML:arser deals with <p> text </p>
>>> from an html file ...
>>>

>>
>> Please read the posting guidelines posted here regularly.



>> So, go back and post a small, self-contained script that still
>> exhibits the problem.

>
> Grated soem sample code would of been nice,



More than nice. It nearly guarantees a useable answer.

It is in a poster's best interest to do what they can to get a
useable answer.


> Your assine tone, as well as your direct insults to the OP, was
> completely unwarrented.



I think you are lacking some pertinent information, and your
conclusion makes you look foolish.


> You could of just rplied asking for more information,



We have done this dozens of times for this OP.

We have asked this OP many times[1] to see the Posting Guidelines
if he wants the best chance at getting an answer.

There is a significant history here that you appear to be ignorant of.



> There is NO excuse for your tone in this thread.



There is NO excuse for acting like you know what has happened here
when you have not been here to see what is happening here, so:

*plonk*

You are speaking from ignorance. Mighty embarrassing in such
a public forum! Perhaps you should have waited until you could
followup on something that you actually know something about.

Geoff has proven a rather persistent disregard for the time
of other people. We are here only to serve his needs, so it
is no big deal if we have to work a little harder or ignore
his threads.



[1] Here are at least 6 such times:

http://groups.google.com/groups?as_q...lang.perl.misc

I get the feeling we are "talking to the hand" here...

--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
187
Guest
Posts: n/a
 
      10-14-2004
Tom wrote:
> 187 wrote:


[ snip unwarrented and non-sequitor drivel ]

FYI I've programming, working networks, IT, and help desks since the
80's. You know nothing of me. It's people like /you/ who can only
attempt to form an argument or rebuttal using personal attacks, and try
to bait fights.

I care not for you reply, as you have proven you have nothing of worth
to say. We do no need sheer hate being spread here.


 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      10-14-2004
Geoff Cox <(E-Mail Removed)> wrote:

> I cannot seem to work out how HTML:arser deals with <p> text </p>



> It breaks up a paragraph by placing a </p> <p> inside a paragraph of
> text in what seems to me to be a random fashion...



If you show us your code, we might be able to help fix it.

Make a short and complete program *that we can run* that shows
this phantom "</p> <p>" thing, and we will explain to you
how it got there.


Why not follow the suggestions given in the Posting Guidelines?

If you had, the question would have been answered already instead
of another of your round-and-round threads where there is not
enough information given to be able to solve the problem.

Post a small program. We will fix it.


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
187
Guest
Posts: n/a
 
      10-14-2004
Tad McClellan wrote:
> 187 <(E-Mail Removed)> wrote:
>> A. Sinan Unur wrote:
>>> Geoff Cox <(E-Mail Removed)> wrote in
>>> news:(E-Mail Removed):
>>>
>>>> I cannot seem to work out how HTML:arser deals with <p> text </p>
>>>> from an html file ...
>>>>
>>>
>>> Please read the posting guidelines posted here regularly.

>
>
>>> So, go back and post a small, self-contained script that still
>>> exhibits the problem.

>>
>> Grated soem sample code would of been nice,


Sorry for my horrible typing. I've only had a total of 4 hours of sleep
the past week and a half

>
> More than nice. It nearly guarantees a useable answer.
>
> It is in a poster's best interest to do what they can to get a
> useable answer.


I fully agree. It just seemed to me like the OP at least tried to
explain his problem, though more in words and not so much in code.

I once again apologize if I got a little "off the deep end" back there.


 
Reply With Quote
 
Fred Canis
Guest
Posts: n/a
 
      10-14-2004
Tad McClellan wrote:
> 187 <(E-Mail Removed)> wrote:
>> A. Sinan Unur wrote:
>>> Geoff Cox <(E-Mail Removed)> wrote in
>>> news:(E-Mail Removed):
>>>
>>>> I cannot seem to work out how HTML:arser deals with <p> text </p>
>>>> from an html file ...
>>>>
>>>
>>> Please read the posting guidelines posted here regularly.

>
>
>>> So, go back and post a small, self-contained script that still
>>> exhibits the problem.

>>
>> Grated soem sample code would of been nice,

>
>
> More than nice. It nearly guarantees a useable answer.
>
> It is in a poster's best interest to do what they can to get a
> useable answer.


True.

>> Your assine tone, as well as your direct insults to the OP, was
>> completely unwarrented.

>
>
> I think you are lacking some pertinent information, and your
> conclusion makes you look foolish.


I beg to differ. The post in question here wasn't exactly blossoming
with positive vibes, and as such not likely to help the OP. Come on,
even you can surely admit this?

>> You could of just rplied asking for more information,

>
>
> We have done this dozens of times for this OP.
>
> We have asked this OP many times[1] to see the Posting Guidelines
> if he wants the best chance at getting an answer.


True, but most of which have bene clouded by the rather nagative vibes
there within.

> There is a significant history here that you appear to be ignorant of.


If you mean the history of the OP, well I think it's hardly fair to
exact everyone who posts or read here to keep track of the posting
histroy of every poster. It doesn't mean it couldn't be checked, of
course it could, but I do not think it right at all to give someone such
a thorough beating for missing one. I hardly think this is been such a
heinous offense.


>> There is NO excuse for your tone in this thread.

>
>
> There is NO excuse for acting like you know what has happened here
> when you have not been here to see what is happening here, so:
>
> *plonk*


Please don't start there. You and others can be great people with a
wealth of knowlege, but some of you are *way* too quick to puul the
plonk-trigger. I think what we have here is a mis understanding, at
least that's how I see it.

> You are speaking from ignorance. Mighty embarrassing in such
> a public forum! Perhaps you should have waited until you could
> followup on something that you actually know something about.



Again, I don't see the point of chastising a poster for not knowing the
posting history of every past poster in this group. It's almost absurd
to expect everyone to know. I regularly frequent this group, rarely
posting though, but a rather regular reader, and I too have missed what
ever incident this OP was apparently involved in.


Maybe best to let thread jsut die instead of going on so bitterly.


 
Reply With Quote
 
187
Guest
Posts: n/a
 
      10-14-2004
Tad McClellan wrote:

> You are speaking from ignorance. Mighty embarrassing in such
> a public forum! Perhaps you should have waited until you could
> followup on something that you actually know something about.
>
> Geoff has proven a rather persistent disregard for the time
> of other people. We are here only to serve his needs, so it
> is no big deal if we have to work a little harder or ignore
> his threads.


I am sorry I did nto know this at first. I do not have time to keep
track of everything that goes on in the dozens of groups I suscribe in.
It seems illogical to me to exact everyone to automatically be aware of
any and all events. May I should go tosses the Op's name in google (and
set the group to this one.) I might of done jsut that if I wasn't in
such a rush.

I once again want to pologize for how I came out in this. I'm not a bad
person, I am in fact a tech as well. I love Perl and think it's the best
thing for programming since sliced bread, and that it's one of the most
intelligent language I've ver had the privilage to learn and become
proficient in. Before Perl I was just a C/C++ programmer doing mostly
freelance. I learned Perl and completely changed how I code many things
in shell/cgi/etc for both work and personal tasks.

I hope there are no hard feelings.



 
Reply With Quote
 
David H. Adler
Guest
Posts: n/a
 
      10-14-2004
On 2004-10-14, Fred Canis <(E-Mail Removed)> wrote:
> Tad McClellan wrote:
>
>> There is a significant history here that you appear to be ignorant of.

>
> If you mean the history of the OP, well I think it's hardly fair to
> exact everyone who posts or read here to keep track of the posting
> histroy of every poster. It doesn't mean it couldn't be checked, of
> course it could, but I do not think it right at all to give someone such
> a thorough beating for missing one. I hardly think this is been such a
> heinous offense.


I think tad's point is that if one is going to lambaste people for their
response to a poster, one might check whether there is some reason for
that response, rather than that one should check the posting history
relevant to any given thread.

dha

--
David H. Adler - <(E-Mail Removed)> - http://www.panix.com/~dha/
You kids today have it easy. I remember when we had to write programs
with an ice pick and index cards. <Note: This joke is not Y2k
compliant. Soon people will ask, "What's an ice pick?"> - Lee Sharp
 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      10-14-2004
"187" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Tad McClellan wrote:
>
>> You are speaking from ignorance. Mighty embarrassing in such
>> a public forum! Perhaps you should have waited until you could
>> followup on something that you actually know something about.
>>
>> Geoff has proven a rather persistent disregard for the time
>> of other people. We are here only to serve his needs, so it
>> is no big deal if we have to work a little harder or ignore
>> his threads.

>
> I am sorry I did nto know this at first.


....

> I'm not a bad person, I am in fact a tech as well. I love Perl


Well, clearly. Why else would you read this group?

OTOH, I would think that someone who wishes to appear friendly might want
to avoid the nickname '187'.

As for my reaction to the OP, I find it particularly unproductive and
annoying to blame the package rather than look for an error in one's own
code. This was especially so since the OP provided no code of his own which
we could have looked at to test his assertion that the package was somehow
at fault.

Referring to the original post:

Geoff Cox <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> I cannot seem to work out how HTML:arser deals with <p> text </p>
> from an html file ...
>
> It breaks up a paragraph by placing a </p> <p> inside a paragraph of
> text in what seems to me to be a random fashion...


The "It" in the second paragraph surely refers to HTML:arser.

I stand by my belief that this is a "stupid" way to approach programming
problems. One should ask

+ Here is what I am doing
+ Here is what I would like to have happen
+ Instead, here is what is happening
+ What am I doing wrong?

Repeatedly ignoring this advice brings to mind the extremely apropos maxim
(I am probably misquoting this):

once is happenstance, twice coincidence, thrice is enemy action

and deserves a somewhat harsher than the usual mild reminder that the OP
read the posting guidelines.

Sinan.
 
Reply With Quote
 
Geoff Cox
Guest
Posts: n/a
 
      10-14-2004
On 14 Oct 2004 00:07:44 GMT, "A. Sinan Unur"
<(E-Mail Removed)> wrote:


>I think you probably want to emit the start and end tags only when the
>start and end callbacks are invoked. I tried to shorten your script to deal
>only with the p case:


Many thanks for the code below - it woks fine and I will try to get to
grips with how it achieves this. You can no doubt see that I do not
have a very good understanding of HTML:arser !

Do you have any suggestions re possible HTML:arser tutorial type
places on the net? I have looked but not found anything that starts
far enough back ...

I have now bought the Perl & LWP book by Sean Burke - any others
spring to mind?

Thanks again for your help.

Cheers

Geoff







>use strict;
>use warnings;
>
>package MyParser;
>use base qw(HTML:arser);
>
>my ($in_p, $fh);
>
>sub register_fh { $fh = $_[1]; }
>
>sub start {
> my ($p, $t, $a, undef, $txt ) = @_;
>
> if ($t eq 'p') {
> $in_p = 1;
> print $fh '<p>';
> return;
> }
>}
>
>sub end {
> my ($p, $t, $txt) = @_;
>
> if ($t eq 'p') {
> $in_p = 0;
> print $fh "</p>\n";
> return;
> }
>}
>
>sub text {
> my ($p, $txt) = @_;
> print $fh $txt if ($in_p);
>}
>
>package main;
>
>my $p = MyParser->new;
>$p->register_fh(\*STDOUT);
>
>print <<HEADER;
><html>
><head>
><title>Test Output</title>
></head>
><body>
>HEADER
>
>$p->parse_file(\*DATA);
>
>print <<FOOTER;
></body>
></html>
>FOOTER
>
>__DATA__
><html>
><head>
><title>test</title>
></head>
>
><body>
>
><h2>test file</h2>
>
><p>The is some text which I am using to test whether para.pl using
>HTML:arser will output all of the text in this paragraph in one
>paragraph, or, in two smaller paragraphs.</p>
>
>
></body>
></html>


 
Reply With Quote
 
187
Guest
Posts: n/a
 
      10-14-2004
A. Sinan Unur wrote:
> "187" <(E-Mail Removed)> wrote in
> news:(E-Mail Removed):
>
>> Tad McClellan wrote:
>>
>>> You are speaking from ignorance. Mighty embarrassing in such
>>> a public forum! Perhaps you should have waited until you could
>>> followup on something that you actually know something about.
>>>
>>> Geoff has proven a rather persistent disregard for the time
>>> of other people. We are here only to serve his needs, so it
>>> is no big deal if we have to work a little harder or ignore
>>> his threads.

>>
>> I am sorry I did nto know this at first.

>
> ...
>
>> I'm not a bad person, I am in fact a tech as well. I love Perl

>
> Well, clearly. Why else would you read this group?


Good point.

> OTOH, I would think that someone who wishes to appear friendly might
> want to avoid the nickname '187'.


Why is that? This is how I uniquely identify myself. If "187" means
something else that I am not awre of please let me know. Other wise I
can go back ot posting under my name "Al" (which also appears in my
email address.)

> As for my reaction to the OP, I find it particularly unproductive and
> annoying to blame the package rather than look for an error in one's
> own code. This was especially so since the OP provided no code of his
> own which we could have looked at to test his assertion that the
> package was somehow at fault.


True. I do admit I was quick to judge and I'm sorry for snapping at you.

> Referring to the original post:
>
> Geoff Cox <(E-Mail Removed)> wrote in
> news:(E-Mail Removed):


That has got to be the longest message ID I've ever laid eyes on
(between 'news:' amd '@ax.com'.)

>> I cannot seem to work out how HTML:arser deals with <p> text </p>
>> from an html file ...
>>
>> It breaks up a paragraph by placing a </p> <p> inside a paragraph of
>> text in what seems to me to be a random fashion...

>
> The "It" in the second paragraph surely refers to HTML:arser.
>
> I stand by my belief that this is a "stupid" way to approach
> programming problems. One should ask
>
> + Here is what I am doing
> + Here is what I would like to have happen
> + Instead, here is what is happening
> + What am I doing wrong?
>
> Repeatedly ignoring this advice brings to mind the extremely apropos
> maxim (I am probably misquoting this):



Agreed. No arguements here.

> once is happenstance, twice coincidence, thrice is enemy action
>
> and deserves a somewhat harsher than the usual mild reminder that the
> OP read the posting guidelines.


All understood. I am once again sorry, and hope there are no hard
feelings.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM



Advertisments