[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-windows
Subject:    RE: [PHP-WIN] loadXML() strangeness
From:       "Bill Bolte" <billb () hightouchinc ! com>
Date:       2007-07-26 20:46:20
Message-ID: 013FC758865CF645976E313AEB6A709904DCC3E9 () htmail ! hightouchinc ! com
[Download RAW message or body]

Well, I stumbled across this, and it seems to have helped. I put this
right before the if:

$dom->validateOnParse=true;

And now I get a false. It's still throwing the warning (which is strange
to me), but that can be handled... 

-----Original Message-----
From: Bill Bolte [mailto:billb@hightouchinc.com] 
Sent: Thursday, July 26, 2007 3:17 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] loadXML() strangeness

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

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic