I can't visualize what you're trying to do. Can you present a
simplified version of the markup and explain what you want to
accomplish?
> 1) I don't know how to make a Tag that has nothing in it. If you say
> soup.new_tag("")
> it creates <></>, which is fine because then you can build the tag by saying
> things like t.name = "span". But it would also be nice to have a tag with
> nothing at all in it that you could append just what you want into without
> having to cope with the extra surrounding <whatever></whatever>
What's the difference between this "tag that has nothing in it", and a list?
Would it help if there was a method Tag.set_contents(), where you can
pass in a list of tags and strings, and have them become the new
contents of a tag?
> 2) I don't know how to make a deep copy. If you move a tag around it drags
> all its connections with it, so you end up easily getting into infinite loop
> situations when you do replace_with().
We talked about the infinite loop off-list. Is that how you're moving
the tags around? I recommend using extract() and
insert()/replace_with() to move tags around, rather than just using
replace_with().
Leonard
--
You received this message because you are subscribed to the Google Groups "beautifulsoup" group.
To post to this group, send email to beauti...@googlegroups.com.
To unsubscribe from this group, send email to beautifulsou...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beautifulsoup?hl=en.