Hi I'm trying to convert the XML file into associative array by using the following code - $xmlUrl = '../products.xml';
-
$xmlStr = file_get_contents($xmlUrl);
-
$xmlObj = simplexml_load_string($xmlStr); print_r ($xmlObj);exit;
-
$arrXml = objectsIntoArray($xmlObj);
and product.xml containing - <?xml version="1.0" encoding="utf-8"?>
-
<products>
-
<product>
-
<sku>p750h3</sku>
-
<category>Plans: Vodafone Unlimited Cap</category>
-
<price>$0</price>
-
<totalmonthlycost>$129</totalmonthlycost>
-
<totalmincost>$3096</totalmincost>
-
<upfront>$0</upfront>
-
<imageurl>http://store.vodafone.com.au/Images/Upload/nokia-6260-slide-front_118x307.png</imageurl>
-
<threedurl>http://store.vodafone.com.au/handset-nokia-6260-slide.aspx#3d</threedurl>
-
<smallimageurl>http://store.vodafone.com.au/Images/Upload/nokia-6260-slide-front_23x60.png</smallimageurl>
-
<name>Nokia 6260 Slide $129 Unlimited Cap - 24 Months</name>
-
<description></description>
-
<ctppage>http://store.vodafone.com.au/handset-nokia-6260-slide.aspx</ctppage>
-
<features>
-
<![CDATA[
-
Exclusive to Vodafone, this advanced all – in - one device has advanced web and navigation features plus a handy 360 degree Navi key to help you stay in control.<br/><ul>
-
<li>5 MP camera with Carl Zeiss optics and Flash</li>
-
<li>WiFi, HSDPA and HSUPA</li>
-
<li>Integrated GPS Navigation</li>
-
<li>3G (<a href="/whatis3g-popup.aspx" onclick="window.open(this.href,'','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=600,height=590,status'); return false"><u>What's this?</u></a>)</li>
-
</ul>
-
]]>
-
</features>
-
<available>Yes</available>
-
<shippingcost>$0.0</shippingcost>
-
<dimensions></dimensions>
-
<manufacturer>Nokia</manufacturer>
-
<modelnumber>6260 Slide</modelnumber>
-
<currency>AUD</currency>
-
<devicekeypoints><ul>
-
-
<li>5 MP camera with Carl Zeiss optics and Flash</li>
-
<li>WiFi, HSDPA and HSUPA</li>
-
<li>Integrated GPS Navigation</li>
-
<li>3G (<a href="/whatis3g-popup.aspx" onclick="window.open(this.href,'','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=600,height=590,status'); return false"><u>What's this?</u></a>)</li>
-
-
</ul></devicekeypoints>
-
<deviceTagline></deviceTagline>
-
<deviceColor>Black</deviceColor>
-
<deviceSpecialOffers></deviceSpecialOffers>
-
<deviceMonthlyHandsetCost>0.0</deviceMonthlyHandsetCost>
-
<deviceRecommendedPlan>$129 Unlimited Cap - 24 Months</deviceRecommendedPlan>
-
<deviceOverallRating></deviceOverallRating>
-
<plan>
-
<term>24</term>
-
<monthlyCapCost>$129</monthlyCapCost>
-
<getMonthly>
-
<![CDATA[Monthly credit amount - UNLIMITED<br/>Monthly data - 4GB<sup>3</sup><br/>Vodafone to Vodafone Calls - UNLIMITED<br/>Also includes - Voicemail retrieval <br/><br/>Flexi credit amount - NA<br/>Standard national voice calls - UNLIMITED<br/>Standard txt and pxt - UNLIMITED<br/>]]>
-
</getMonthly>
-
</plan>
-
</product>...etc
but it returns a error message as follows - Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : String not started expecting ' or " in D:\EBU\xampp\htdocs\biglinks\include\productUpdate.php on line 24
-
-
Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version=\"1.0\" encoding=\"utf-8\"?> in D:\EBU\xampp\htdocs\biglinks\include\productUpdate.php on line 24
-
-
Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in D:\EBU\xampp\htdocs\biglinks\include\productUpdate.php on line 24
-
-
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Malformed declaration expecting version in D:\EBU\xampp\htdocs\biglinks\include\productUpdate.php on line 24
-
-
Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version=\"1.0\" encoding=\"utf-8\"?> in D:\EBU\xampp\htdocs\biglinks\include\productUpdate.php on line 24
-
-
Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in D:\EBU\xampp\htdocs\biglinks\include\productUpdate.php on line 24......etc
I am trying to fix this issue whole day and searching solution over the net but i could not get . Please let me know the reason?
0 1248 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Walter Zydhek |
last post by:
Is it possible to convert an ArrayList to a string array?
I have a routine that takes a string array as a parameter,
converts it to an ArrayList for manipulation purposes,
and now I need to...
|
by: Jeff Johnson |
last post by:
Hi,
I've begun converting an ASP site over to .NET and I'm a novice at both the
new platform as well as C#.
I have a COM+ object that returns a string array when it is called. The
size of...
|
by: Dick Swager |
last post by:
The following code is from a solution with a C++ project and a C# project.
The C++ project creates a managed array and the C# project tries to use it.
But I am having a 'System.ValueType' to...
|
by: diDE |
last post by:
I want to convert a managed string array
f.e. array<string^>^ Texts; // Elements 0: "ABC", 1: "HJO"
to a TCHAR** or wchar_t**
any ideas?
|
by: Andrew Banks |
last post by:
Can anyone see aproblem with this line of code
string rolelistarray = rolelist.ToArray(GetType(System.String));
I'm getting a problem with the GetType(System.String) section
|
by: wrytat |
last post by:
In one web page, I redirect it to "prtDelReq.aspx?prtindex=0A2A3A8" after the
user click the button.
The prtindex actually contains many integers separated by 'A'.
On the prtDelReq page, I use...
|
by: Nikolay Petrov |
last post by:
I have a string array, which I need to save to a file.
The array may grow to thousands of elements.
My question is what is the fastest way to save it as text file?
The StreamWriter accepts String...
|
by: Chuck Cobb |
last post by:
I'm having a problem converting an array to a collection. The code I'm
using looks like the following:
CustomerInfo cArray;
Collection<CustomerInfo> cCollection = new...
|
by: kmitchell00 |
last post by:
I am coding in Coldfusion MX7 and using Javascript for some of the functionality. The basic functionality I'm coding is, based on a value the user chooses from a dropdown box, I populate address...
|
by: shahiz |
last post by:
basically im having null pointer exception
//read an inputstream
is = new DataInputStream(new FileInputStream("test.mpg"));
loadBytes(is);
//pass it as a datasource for the player
public...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |