Jump to content


Photo

DomElement set_content


  • Please log in to reply
3 replies to this topic

#1 spongebobusa

spongebobusa
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 August 2006 - 06:11 AM

I am not sure why I am getting this error.  DOMElement is a sublcass of DomNode.

Fatal error: Call to undefined method DOMElement::set_content()

Here is my code snippet.

$var = new DomElement("name");
$var->set_content("some_content");

Thanks in advance.  I am using PHP 5.1.2 and PHP 5.1.4

#2 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 24 August 2006 - 08:56 AM

Maybe you're trying to use a DOM XML method on a DOM object?  ;D php5 no longer has the depreciated DOM XML library.

Note:  This extension is no longer marked experimental. It will, however, never be released with PHP 5, and will only be distributed with PHP 4. If you need DOM XML support with PHP 5 you can use the DOM extension. This domxml extension is not compatible with the DOM extension.



#3 spongebobusa

spongebobusa
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 August 2006 - 02:50 PM

I don't understand.  what should I be using instead?

#4 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 24 August 2006 - 08:42 PM

$domNode->nodeValue = 'some content';

Read up.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users