simplexml


Can't turn XML response into an simplexml object


I asked this question before but I got no answers. I'll try to narrow down the question.
See this post
What's wrong with this code:
$url = "http://.../fogbugz/api.asp?cmd=logon&email=" . $_UN . "&password=" . $_PW;
$resp = new SimpleXMLElement(file_get_contents($url));
Yields:
SimpleXMLElement Object ( [token] => SimpleXMLElement Object ( ) )
If I output the response of file_get_contents directly to the screen using a header I see the response is correct and the token element is filled with a valid token. Yet simplexml doesn't seem to be able to read the token.
I don't think SimpleXML is able to parse CDATA sections and since most of what the FogBugz XML API returns is UTF-8 data, it is put into XML CDATA blocks. Your browser might be hiding that from you, but if you look at the raw info return from cmd=logon, I believe it is a CDATA.

Related Links

SimpleXml tar.gz
simplexml_load_file error in PHP 5.3
simplexml_load_file not a valid URI issue
Can't turn XML response into an simplexml object
Having trouble getting Fogbugz API response into a SimpleXML object
Upgraded to php 5.3.10 and simpleXMLelement is broken
Parsing RSS Feed with SimpleXML
php simplexml_load_file (script url) failed to open stream
PHP - SimpleXML not returning object
Having trouble processing XML with PHP SimpleXML
Simplexml How to access all element of the same node
simplexml_load_file failed to open stream Http request failed
Using XML node names with hyphens in PHP [duplicate]
SimpleXML Reading node with a hyphenated name
PHP simplexml Entities
PHP simplexml_load_string include form field data

Categories

HOME
cakephp
testing
zeromq
urbancode
react-virtualized
view
q
google-project-tango
yum
paradox
cross-validation
slick-slider
python-unittest
here-api
spring-xd
nstableview
usergrid
size
foselasticabundle
reactive-cocoa
trading
firebase-crash-reporting
xpages-ssjs
javacv
virtualdub
rst2pdf
fifo
webkitspeechrecognition
semantic-versioning
pdb
jspresso
winrt-xaml-toolkit
adobe-premiere
jquery-bootgrid
scaffold
libraries
email-templates
ensembles
gulp-sourcemaps
quadratic-programming
websphere-mq-fte
python-webbrowser
jlink
epson
color-profile
account-kit
transmitfile
mongocsharpdriver
websitepanel
hill-climbing
python-stackless
packagist
nessus
independentsoft
javax.sound.midi
tcpserver
graph-drawing
processmodel
fluid-dynamics
iiviewdeckcontroller
nstableviewcell
asp.net-web-api-odata
internet-connection
datagridviewcolumn
java.nio.file
industrial
page-layout
ruby-datamapper
ftps
eclipse-memory-analyzer
sabredav
cassini-dev
wsdl-2.0
dice
armcc
onsubmit
jquery-ui-layout
eclipse-templates
genshi
invite
table-footer
floating
lang
h.323
forums
user-friendly
nintendo-ds
audio-capture
eqatec
gacutil
mediarss
misv

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App