![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
programmers - help with xml feed
So I am trying to read in an xml feed with php, however the feed has thrown me a bit of a curve ball.
It starts off as a normal xml feed, however mid way it changes and this is what is throwing me. How do I handle a feed that does the following : ? PHP Code:
cheers
__________________
TripleXPrint on Megan Fox "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!" |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Industry Role:
Join Date: Dec 2013
Posts: 49
|
the right way: request to from the source of xml to send valid xml :-)
alternative way: sanitize the data, fix the xml or extract data with regexp -> but both is not the right way.... |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
Quote:
Was hoping for a way to loop through without having to sanitize the data as you mentioned. Thanks for the reply.
__________________
TripleXPrint on Megan Fox "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!" |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Just Doing My Own Thing
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 25,108
|
I feed most XML through DreamWeaver and add it as a recordset - It is pretty good at sorting out strange looking XML like that...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
Quote:
Right now, I can read in bits of the xml feed, but not all of it because they have made it in such a shit of a way.
__________________
TripleXPrint on Megan Fox "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!" |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
Bump?............
__________________
TripleXPrint on Megan Fox "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!" |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Registered User
Industry Role:
Join Date: Dec 2013
Posts: 49
|
I'm not sure if I catch the realy problem, does PHP accept the XML you get or you get there a error? If Simple XML or whatever engine you use take it, you could use xpath to get what you need.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,372
|
can you give me a live url to the xml feed so i can give you the code?
chris @ lod.com
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
XML Parsing Error: mismatched tag. Expected: </newelement>. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
Code:
$VAR1 = { 'item' => [ { 'itemid' => {} }, { 'itemid' => {} }, { 'itemid' => {} }, { 'itemid' => {} } ], 'newelement' => { 'newsubelement' => [ { 'item' => [ { 'itemid' => {} }, { 'itemid' => {} }, { 'itemid' => {} } ] }, { 'item' => [ { 'itemid' => {} }, { 'itemid' => {} }, { 'itemid' => {} }, { 'itemid' => {} } ] } ] } }; |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
|
create 1 php to sanitize data and or format the wront xml to correct xml,, then use your regular xml code to parse the xml.
or you can just create one file of it.
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Aug 2012
Posts: 1,768
|
You have elements and subelements. Please send me whole code you used to parse this, and one of my devs will fix it for you
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |