HTML::ParseTree delete/modify child text

Discussion in 'Perl' started by Richard Bell, Jun 4, 2004.

  1. Richard Bell

    Richard Bell Guest

    Given an HTML::parseTree node $n. Given its content as returned by my
    @content = $n->content_list(). @content potentially consists of text or
    references to other nodes. Regarding those elements of @content
    containing text:

    How does one modify the content of a specific text child within the
    containing node?

    How does one delete a specific text child within the containing node?

    Consider the HTML fragment:

    <div> String 1 <h3> String 2 </h3> String 3 <h3> String 4 </h3> String 5
    </div>

    $n->content_list would contain ( 'String 1', ref to <h3> containing
    String 2, 'String 3', ref to <h3> containing String 4, 'String 5' )

    I can delete the child nodes with $ref->delete. But how do I mess with
    the strings?

    Thanks.
     
    Richard Bell, Jun 4, 2004
    #1
    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. davout
    Replies:
    0
    Views:
    571
    davout
    Apr 18, 2004
  2. Bryan Ax
    Replies:
    6
    Views:
    561
    Peter Flynn
    May 17, 2006
  3. Jeff Rodriguez
    Replies:
    23
    Views:
    1,181
    David Schwartz
    Dec 9, 2003
  4. Juan Garcia
    Replies:
    2
    Views:
    122
    Juan Garcia
    Jul 31, 2003
  5. Richard Bell

    HTML::ParseTree delete/modify child text

    Richard Bell, Jun 4, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    86
    Richard Bell
    Jun 4, 2004
Loading...

Share This Page