http://search.cpan.org/grep?cpanid=PETEK&release=HTML-Tree-3.23&string=XHTML+&i=1&n=1&C=0
http://search.cpan.org/grep?cpanid=PETEK&release=HTML-Tree-3.23&string=%2F%3E&i=1&n=1&C=0
http://search.cpan.org/grep?cpanid=PETEK&release=HTML-Tree-3.23&string=empty&i=1&n=1&C=0
http://search.cpan.org/src/PETEK/HTML-Tree-3.23/lib/HTML/Element.pm
sub starttag { my($self, $entities) = @_; my $name = $self->{'_tag'}; return $self->{'text'} if $name eq '~literal'; return "<!" . $self->{'text'} . ">" if $name eq '~declaration'; return "<?" . $self->{'text'} . ">" if $name eq '~pi'; if($name eq '~comment') { if(ref($self->{'text'} || '') eq 'ARRAY') { # Does this ever get used? And is this right? return "<!" . join(' ', map("--$_--", @{$self->{'text'}})) . ">" ; } else { return "<!--" . $self->{'text'} . "-->" } } my $tag = $html_uc ? "<\U$name" : "<\L$name"; my $val; for (sort keys %$self) { # predictable ordering next if !length $_ or m/^_/s or $_ eq '/'; $val = $self->{$_}; next if !defined $val; # or ref $val; if ($_ eq $val && # if attribute is boolean, for this elemen +t exists($HTML::Element::boolean_attr{$name}) && (ref($HTML::Element::boolean_attr{$name}) ? $HTML::Element::boolean_attr{$name}{$_} : $HTML::Element::boolean_attr{$name} eq $_) ) { $tag .= $html_uc ? " \U$_" : " \L$_"; } else { # non-boolean attribute if (ref $val eq 'HTML::Element' and $val->{_tag} eq '~literal') { $val = $val->{text}; } else { HTML::Entities::encode_entities($val, $entities) unless (d +efined($entities) && !length($entities)); } $val = qq{"$val"}; $tag .= $html_uc ? qq{ \U$_\E=$val} : qq{ \L$_\E=$val}; } } # for keys if ( scalar $self->content_list == 0 && $self->_empty_element_map- +>{ $self->tag } ) { return $tag . " />"; } else { return $tag . ">"; } }

In reply to Re: HTML::TreeBuilder and HTML4.01 empty elements by Anonymous Monk
in thread HTML::TreeBuilder and HTML4.01 empty elements by wfsp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.