Monday, November 10, 2008

with the php domdocument class was getting the following error:

Warning: main() [function.main]: unterminated entity reference 64-bit

this error was occurring when trying to set the name of an anchor element ... the same error popped up when setting both within the constructor and through the nodeValue method. I haven't tested the solution via the constructor, but by wrapping the value with the built-in htmlspecialchars(), I solved this error

$anchornode = $doc->createElement('a');
$anchornode->nodeValue = htmlspecialchars("$somevalue");

1 comment:

Unknown said...

it doesn't seem to work in the constructor, so you should just separately set the node value as demonstrated above