Best way to remove body/html tag from HTML::Element tree

Discussion in 'Perl Misc' started by afrinspray, Sep 6, 2006.

  1. afrinspray

    afrinspray Guest

    What's the best way to remove the <html> and <body> tags from an html
    tree? Does splice_content or detach keep the children? I can also do
    it from a string if you guys can think of a safe regex (sometimes body
    has onLoad, class or other tags).

    Thanks!

    Mike
     
    afrinspray, Sep 6, 2006
    #1
    1. Advertising

  2. afrinspray <> wrote:


    > if you guys can think of a safe regex



    There is no such thing as a safe regex than can handle
    a context free language such as HTML.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Sep 7, 2006
    #2
    1. Advertising

  3. afrinspray

    afrinspray Guest

    afrinspray, Sep 7, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    894
    John C. Bollinger
    Jan 27, 2006
  2. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,202
  3. Replies:
    4
    Views:
    2,612
  4. Kevin
    Replies:
    16
    Views:
    47,484
    Roedy Green
    Jan 30, 2008
  5. John Salerno
    Replies:
    3
    Views:
    267
    Roy Smith
    Mar 12, 2012
Loading...

Share This Page