Re: Subclassing HTML::Parser to support $p->include()

Gisle Aas <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
Andy Armstrong <[email protected]> writes:

> On 24 Feb 2006, at 17:46, Terrence Brannon wrote:
> > If you want to stay pure HTML, then do this:
> >
> > <span myparser_action="include" myparser_args="header.html" />
> 
> The syntax was just chosen for conciseness but the actual syntax
> looks like
> 
> <ido:include src="blah.html" />
> 
> I /assumed/ (perhaps mistakenly) that HTML::Parser would be OK with
> arbitrary tag names provided everything was syntactically correct. Is
> that a stupid assumption?

No, that's a completely valid assumption.  HTML::Parser does not care
what the name of the tags are.  This is needed to have any hope of
parsing real-world HTML and it will certainly stay that way.  No need
to worry.

HTML::Parser does treat a few tags (title, script, style, textarea)
specially in that their content are parsed according to different rules
than normal and unknown tags.

--Gisle
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.