ProblemHelpPlease Posted February 12, 2010 Share Posted February 12, 2010 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 More sharing options...
boen_robot Posted February 12, 2010 Share Posted February 12, 2010 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 More sharing options...
jeffman Posted February 12, 2010 Share Posted February 12, 2010 There is a reader contribution at the bottom of this page that might help: http://us2.php.net/manual/en/xmlreader.read.php Link to comment Share on other sites More sharing options...
boen_robot Posted February 12, 2010 Share Posted February 12, 2010 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 More sharing options...
ProblemHelpPlease Posted February 13, 2010 Author Share Posted February 13, 2010 Thanks guys, I had been playing with expand but couldn't seem to get the code correct, I'll give it a go. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.