Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by ikegami (Pope)
on Nov 04, 2008 at 11:20 UTC ( #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
Node Status?
node history
Node Type: note [id://721351]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-07-11 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?