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_load_file() error happening in only localhost/xampp
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

Categories

HOME
pypi
keycloak
read-eval-print-loop
adb
razor
rdf
fsm
webpack-2
sql-server-2016
ojdbc
iggrid
communication
row
numeral.js
u-sql
alignment
telephony
lucene.net
swingx
jquery-ajaxq
tokenize
opennlp
bootstrap-duallistbox
virtualdub
strncpy
maquette
elasticsearch-ruby
buck
libssl
microsoft-chart-controls
code-contracts
hybridauth
avcapturesession
gammu
ghost4j
appfabric
file-format
git-merge
swift3.0.2
mixture-model
xenforo
temporary-files
email-templates
sfdc
avro4s
fakeiteasy
netcdf4
convertapi
executenonquery
taffy
jedis
errordocument
sage-one
dropbox-php
statsd
kbuild
typed-lambda-calculus
flow-control
flutterwave
dynamics-sl
minimization
xcb
home-directory
flash-cs5
moveit
dlna
photobucket
iis-arr
ios9.1
method-parameters
apache-commons-fileupload
sonarqube5.1.2
tween
fpml
java-metro-framework
has-many-through
article
wp-query
stxxl
viadeo
tidy
google-cloud-save
dbconnection
tws
sabredav
hamiltonian-cycle
tridion-worldserver
objective-c-2.0
amazon-appstore
ohm
spring-portlet-mvc
libc++
blackberry-playbook
joyent
hamachi
tomcat-valve
django-tagging
self-extracting
android-sdk-2.1
xfbml
w3wp.exe
digest-authentication
suppress
gin
modelstate
webkit.net
uimenucontroller
xetex
premature-optimization
putchar
3gp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App