dougieladd Posted February 21, 2007 Share Posted February 21, 2007 I'm new to coding nevermind XML and PHP. However, I have managed (with the help of 'Jubba') to display the content of an XML file on my PHP page. Now, how do I display a specific item within that XML instead of the whole lot? Thanks in advance. And thanks to Jubba at kirupa.com - who wrote the best tutorial for beginners - you should write a book you're very good at explaining this stuff) Link to comment https://forums.phpfreaks.com/topic/39474-display-xml-with-php/ Share on other sites More sharing options...
DeathStar Posted February 21, 2007 Share Posted February 21, 2007 This may be a silly way but try inserting that part into the database and call it to the php page? Link to comment https://forums.phpfreaks.com/topic/39474-display-xml-with-php/#findComment-190449 Share on other sites More sharing options...
hvle Posted February 21, 2007 Share Posted February 21, 2007 Look at the DOM functions in PHP manual Link to comment https://forums.phpfreaks.com/topic/39474-display-xml-with-php/#findComment-190459 Share on other sites More sharing options...
dougieladd Posted February 21, 2007 Author Share Posted February 21, 2007 Not sure I understand. I have : • 1 XML file. (basically a txt file with the xml extension) • 1 php page (called parser.php) I've uploaded and tested it and GREAT it displays all items in the XML file. Woo Hoo ! However I only want to display 1 item. How do I do that? I basically copied the code on here... http://www.kirupa.com/web/xml_php_parse_beginner.htm and then amended it to point to my XML file. Am i making sense? Thanks D Link to comment https://forums.phpfreaks.com/topic/39474-display-xml-with-php/#findComment-190462 Share on other sites More sharing options...
Stal Posted February 23, 2007 Share Posted February 23, 2007 I would be very interested in seeing the solution for this as it would solve a similar problem I am having as well Link to comment https://forums.phpfreaks.com/topic/39474-display-xml-with-php/#findComment-191999 Share on other sites More sharing options...
dougieladd Posted February 23, 2007 Author Share Posted February 23, 2007 I decided to go with using XSLT fragments using Dreamweaver 8. It's really straight forward. 1. Create a new XSLT Fragment page in DW8. (you will be asked to give the location of the XML file here either local or remote) 2. Then in the Bindings panel in DW8 you will see the XML nodes. 3. Simply drag the nodes onto the screen where you need them. _ you have created an XSLT Fragment_ 4. Now create a dynamic page (I'm using php) and insert the fragment you just created here. 5. Dreaweaver creates a directory called 'includes' with some server side code in a a file called "MM XSL Transform class" - this needs to be upoaded to your server also, otherwise it won't work. 6. Upload everything and test in the browser and ta da! it works! 7. You can filter the XML using Xpath Expression builder...which I'm looking at now... Cheers D Link to comment https://forums.phpfreaks.com/topic/39474-display-xml-with-php/#findComment-192008 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.