Re: simplexml choking on apparently valid XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 7, 2010 at 4:32 PM, Brian Dunning <brian@xxxxxxxxxxxxxxxx>wrote:

> This time simplexml-load-string also gave me the same error on the
> following line:
>
> <first_name>Charlie &amp; Brady</first_name>
>
> Can anyone confirm whether simplexml-load-string will or will not accept or
> allow XML-encoded characters? It seems that it should and would be pretty
> surprising if it wouldn't.


hmm, both the strings seem to work fine on my laptop:

php > var_dump(simplexml_load_string('<first_name>Charlie &amp;
Brady</first_name>'));
object(SimpleXMLElement)#1 (1) {
  [0]=>
  string(15) "Charlie & Brady"
}
php > var_dump(simplexml_load_string('<client_orderitem_number>Basketball
Personalized Notebook - Jeff&apos;s</client_orderitem_number>'));
object(SimpleXMLElement)#1 (1) {
  [0]=>
  string(41) "Basketball Personalized Notebook - Jeff's"
}


-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux