Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Using HTML::TreeBuilder to change the DOCTYPE declaration

by ikegami (Patriarch)
on Nov 04, 2008 at 11:20 UTC ( [id://721351]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $ele = $root->look_down(
       _decl => ...was specified...,
    ) or die qq{declaration not found\n};
    
    my $dec = $ele->attr('_decl');
    
  2. or download this
    my $ele = $root->look_down(
       sub { $_[0]->attr('_decl') }
    ) or die qq{declaration not found\n};
    
    my $dec = $ele->attr('_decl');
    
  3. or download this
    my $dec = $root->attr('_decl')
       or die qq{declaration not found\n};
    
  4. or download this
    $dec->attr(text => 'DOCTYPE html PUBLIC "HTML4"');
    
  5. or download this
    $root->attr('_decl',
       HTML::Element->new('~declaration',
          text => 'DOCTYPE html PUBLIC "HTML4"',
       )
    );
    
  6. or download this
    #!/usr/bin/perl
    
    ...
    <head><title>declaration</title></head>
    <body><p>declaration</p></body>
    </html>
    
  7. or download this
    <!DOCTYPE html PUBLIC "HTML4">
    <html><head><title>declaration</title></head><body><p>declaration</bod
    +y></html>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://721351]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found