Jump to content

Problem With Xmlreader::readstring


ProblemHelpPlease

Recommended Posts

The script I am writing is returning an error that is basically complaining about the use of XMLReader::readString. From looking at the php manual it appears the function is only available when PHP is compiled against libxml 20620 or later. My version is not uptodate enough.Is there another option to using readstring?

Link to comment
Share on other sites

You could always manually read() all text nodes, and store their value in a variable along the way, then use the variable.

Link to comment
Share on other sites

That works fine, but I just saw another thing... it appears the expand() method is available in even earlier versions of libxml. It only requires PHP 5.1.2. If you have that, a more efficient (CPU wise at least) way to emulate readString() is to use:

$reader->expand()->textContent;

in place of

$reader->readString();

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...