![]() |
Reading From XML instead of database? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html) +--- Thread: Reading From XML instead of database? (/thread-22798.html) |
Reading From XML instead of database? - El Forum - 09-20-2009 [eluser]saidbakr[/eluser] Hello, I need to know how reading a local, or remote, server xml file and using its data instead of database? For example, Code: <xml> How could I use CI to read this XML file? and what are suitable to do this task, a helper or a plugin? and where could I able to find pre-made such plugins and helpers for CI? Reading From XML instead of database? - El Forum - 09-20-2009 [eluser]saidbakr[/eluser] Hello I found the solution in XML Library inside the CI Wiki. Everything goes well but I need to add <![CDATA[ ]]> to the text content to disallow parsing of HTML tags inside the text here is an example of the xml: Code: <?xml version="1.0" encoding="UTF-8"?> However, The generated array from the xml parser is not clean enough it needed some modification to get the data in the view file to be something like <?php echo $item['title'][0] ?> and the index [0] should be found inside the loop, i.e there are no 1,2, 3 etc it only 0. Thank you all |