NYCPHP Meetup

NYPHP.org

[nycphp-talk] Modifying an XML tag name OR cloning an entire node including childnodes

David Krings ramons at gmx.net
Sun May 27 23:27:40 EDT 2007


Dynamic Ink wrote:
> Basically I am trying to turn something like this:
> <div>Hello <i>Joe</i>, nice to meet you</div>
> into this:
> <p>Hello <i>Joe</i>, nice to meet you</p>

In my naivity I'd propose doing a simple find and replace. After all, 
XML is nothing else than a string or a text file, so replacing the <div> 
with <p> and the </div> with </p> is almost trivial. You can do that 
line by line or for any size portion or even across one or more files.
If it is really only about replacing all instances of one tag with 
another tag then throwing all this complicated stuff at it strikes me as 
a bit of overkill. Chances are that I am missing something here.

David



More information about the talk mailing list