loadXML() strangeness
| From: | Bill Bolte | Date: | Thu, 26 Jul 2007 20:16:36 +0000 |
| Subject: | loadXML() strangeness | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-28250@lists.php.net to get a copy of this message | ||
Maybe it's just me, but this isn't behaving as I think it should.
loadXML() is supposed to return T/F, depending on if it's succeeded or
not. and should throw a false if the XML isn't well-formed. however,
that's not what I'm seeing here. during some testing, the XML I'm trying
to load is blank (except for maybe a return), but it seems to be
returning true and trying to parse it. basically, all I'm doing is:
if($dom->loadXML($fxml) == true){...}
and it appears that the code inside the if is running (I'm writing a
file out of the XML that's being parsed and it's showing up - although
it's empty). here's the warning that's being sent to the page:
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Start
tag expected, '<' not found in Entity, line: 2 in
C:\www\op.dev\public_html\assets\inc\parser.php on line 278
Guess I could always check for a beginning <, but I assumed that
loadXML() would do this? what's the scoop here?
Bill