Welcome Guest, Not a member yet? Register   Sign In
Parsing XML in CI
#1

[eluser]aryan_[/eluser]
Does Codeigniter has xml parser? I want to parse xml file and show its data.
#2

[eluser]skunkbad[/eluser]
I think using the built in SimpleXML class is very easy.

www.php.net/simplexml

It parses XML very nicely.
#3

[eluser]imn.codeartist[/eluser]
yes, you can create your own library using simpleXML
#4

[eluser]aryan_[/eluser]
I did this.

Why don't CI has inbuilt XML parsing class?
#5

[eluser]kyleect[/eluser]
Might as well use this thread for my question. Does anyone know of a way to convert a simplexml object to an array? Or, it easier, does anyone know of an alternate way to parse XML to an array in PHP? Thanks!
#6

[eluser]skunkbad[/eluser]
[quote author="aryan_" date="1254672713"]I did this.

Why don't CI has inbuilt XML parsing class?[/quote]

Probably because php has one that works great, and in my opinion doesn't need to be changed. My car tires are already round. You get me?
#7

[eluser]pistolPete[/eluser]
@kyleect:
Why do you need an array? Why would you prefer an array to an object?
#8

[eluser]skunkbad[/eluser]
Ya know, I guess I hadn't really thought about the CI users who do not have php5. SimpleXML is a php5 class, so perhaps CI users should create a class/library that parses XML like SimpleXML, but for php4. I have used a class like this in the past. I found it online, and probably have it somewhere in my mega script library. If I can find it, I will post it.
#9

[eluser]InsiteFX[/eluser]
Here you go skunkbad, is the one your talking about?

XML PHP4

Enjoy
InsiteFX
#10

[eluser]skunkbad[/eluser]
[quote author="InsiteFX" date="1254710349"]Here you go skunkbad, is the one your talking about?

XML PHP4

Enjoy
InsiteFX[/quote]

Ah yes! Thank you for finding my post! Yes, this class does allow for parsing XML in php4, very similar to php5 SimpleXML usage.




Theme © iAndrew 2016 - Forum software by © MyBB