Re: [PHP] XML parsing without the PHP4 XML functions
Wddx may also be an option. That would allow you to serialize the xml into php variables so that you could use them in your example. But if your provider won't compile xml in, I doubt you'll be able to get wddx. Shaun On Wed, 14 Feb 2001, Stefen Lars wrote: Hello all I have recently been assigned the task of parsing an xml file and format the contents of the file in HTML. The xml file lies on another server. Our web space provider does not provide the XML functions (nor is he willing to install them) :-gr. I am sure that I am not the only who has come across this problem. Would someone have already created a few functions to parse xml that they are willing to share? I have the following structure to deal with: faq item productProductName/product questionWhy does it not work/question answerBecause it is not turned onanswer item /faq There are whole load of items in the file. I then want to display the contents a bit like this: echo $product; echo $question; etc (of course with some HTML formatting, like a bulleted list). Any help would be really VERY appreciated! Thanks S _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] XML parsing without the PHP4 XML functions
Hello all I have recently been assigned the task of parsing an xml file and format the contents of the file in HTML. The xml file lies on another server. Our web space provider does not provide the XML functions (nor is he willing to install them) :-gr. I am sure that I am not the only who has come across this problem. Would someone have already created a few functions to parse xml that they are willing to share? I have the following structure to deal with: faq item productProductName/product questionWhy does it not work/question answerBecause it is not turned onanswer item /faq There are whole load of items in the file. I then want to display the contents a bit like this: echo $product; echo $question; etc (of course with some HTML formatting, like a bulleted list). Any help would be really VERY appreciated! Thanks S _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] XML parsing without the PHP4 XML functions
If your satisfied with IE5.0 customers you could do all that without php, use an XSL file. Now if you want PHP to parse the XML file, I can see why, your going to have to get XML installed. Have you considered other providors? there are lots. Im one of them. Ive been told there are ways of adding modules dynamically on runtime http://php.net/manual/en/function.dl.php Ive never needed it / used it. sorry :( -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Stefen Lars"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello all I have recently been assigned the task of parsing an xml file and format the contents of the file in HTML. The xml file lies on another server. Our web space provider does not provide the XML functions (nor is he willing to install them) :-gr. I am sure that I am not the only who has come across this problem. Would someone have already created a few functions to parse xml that they are willing to share? I have the following structure to deal with: faq item productProductName/product questionWhy does it not work/question answerBecause it is not turned onanswer item /faq There are whole load of items in the file. I then want to display the contents a bit like this: echo $product; echo $question; etc (of course with some HTML formatting, like a bulleted list). Any help would be really VERY appreciated! Thanks S _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] XML parsing without the PHP4 XML functions
I haven't done this in PHP as PHP comes w/ XML support but times past when I needed a fast way to parse something like that and knew the format would be simple I'd usually do something like make a function that knows all the possible splits w/in a layer (ie items are w/in the faq layer if they can occur inside faq tags) and then just recursively explode the string parts based on all know tags for that layer and build a nested array or prehaps nested objects. That is probably the simplist way if you don't want to mess w/ real parsing. If you have Unix access you might see if you can use Perl or a helper app to parse it into an easier to work w/ format. Stefen Lars wrote: Hello all I have recently been assigned the task of parsing an xml file and format the contents of the file in HTML. The xml file lies on another server. Our web space provider does not provide the XML functions (nor is he willing to install them) :-gr. I am sure that I am not the only who has come across this problem. Would someone have already created a few functions to parse xml that they are willing to share? I have the following structure to deal with: faq item productProductName/product questionWhy does it not work/question answerBecause it is not turned onanswer item /faq There are whole load of items in the file. I then want to display the contents a bit like this: echo $product; echo $question; etc (of course with some HTML formatting, like a bulleted list). Any help would be really VERY appreciated! Thanks S _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]