CliffLandin
Programmer
The Background:
I am developing a site that queries a booking agent that returns an XML doc full of booking information. I use file_get_contents to return the data as a string which is then parsed using simplexml_load_string. I had been using simplexml_load_file and passing it the url, but I then found out that there is a problem with simplexml objects being loaded into sessions. So, I was hoping to retrieve the doc as a string which I would then load into the session and be able to parse it at any time without having to query the booking agent again.
The Quandry:
The string that file_get_contents returns is not an element that I can manipulate. The information is there and is parsed by the simplexml_load_string, but if I try to load it into the session and then dump the $_SESSION the variable is empty. On the same note, if I echo the string it shows nothing, but if I view source on the page all the information is there.
The Question:
Is there a way to take this XML doc and convert it to a string that I can then place in the session and then later parse with simplexml_load_string?
The Answer:
?
Thanks for any help that you can provide.
When in doubt, go flat out!
I am developing a site that queries a booking agent that returns an XML doc full of booking information. I use file_get_contents to return the data as a string which is then parsed using simplexml_load_string. I had been using simplexml_load_file and passing it the url, but I then found out that there is a problem with simplexml objects being loaded into sessions. So, I was hoping to retrieve the doc as a string which I would then load into the session and be able to parse it at any time without having to query the booking agent again.
The Quandry:
The string that file_get_contents returns is not an element that I can manipulate. The information is there and is parsed by the simplexml_load_string, but if I try to load it into the session and then dump the $_SESSION the variable is empty. On the same note, if I echo the string it shows nothing, but if I view source on the page all the information is there.
Code:
Example of XML visible when viewing the page source.
<?xml version="1.0" encoding="utf-8"?><SearchResults><Errors /><Session ID="0B2A0F05-5B5E-416B-9C5D-6E72DD375375" SalesID="*****" DestinationID="0" Region="" Country="" ArrivalDate="04/09/2007" ArrivalTime="00:00:00" DepartureDate="04/23/2007" DepartureTime="00:00:00" AdultCount="1" ProductCategoryID="1" LengthOfStay="14" DaysUntilArrival="1" Test="0" /><SearchSpeed SearchMarker1="2140" SearchMarker2="3640" SearchEnd="7563" /><Locations>...
The Question:
Is there a way to take this XML doc and convert it to a string that I can then place in the session and then later parse with simplexml_load_string?
The Answer:
?
Thanks for any help that you can provide.
When in doubt, go flat out!