Re: DOM - change a tag name ??
| From: | Andrew Ballard | Date: | Wed, 11 Mar 2009 18:28:57 +0000 |
| Subject: | Re: DOM - change a tag name ?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289880@lists.php.net to get a copy of this message | ||
On Wed, Mar 11, 2009 at 11:52 AM, Michael A. Peters <mpeters@mac.com> wrote:
> If I'm manipulating a dom object, is there a way to change the tag name?
> I know you manipulate just about everything else in a node - but is the
> tagName really off limits?
>
> from the documentation for DOMElement -
>
> /* Properties */
> readonly public bool $schemaTypeInfo ;
> readonly public string $tagName ;
>
> so if I really needed to change it, I'd have to create a virgin node with
> the new name, identical attributes and children, and replace the existing
> node with the new one?
>
> Is there any other way to alter the tagName without doing all that?
>
If this is related to your earlier post about attributes, is XSLT not
an option? I hate to sound like a broken record, but PHP has support
for XSL transformations and it sounds like that is exactly what you
are trying to do.
Andrew