Omzy Posted June 2, 2009 Share Posted June 2, 2009 How can I use XPath to read in an XML document, run a query to filter out some of the data and then save the filtered data as a new XML file? Link to comment https://forums.phpfreaks.com/topic/160626-xpath-and-php/ Share on other sites More sharing options...
RichardRotterdam Posted June 2, 2009 Share Posted June 2, 2009 There is more then one way. Here are two for you. domxpath simplexml-element-xpath Link to comment https://forums.phpfreaks.com/topic/160626-xpath-and-php/#findComment-848047 Share on other sites More sharing options...
Omzy Posted June 2, 2009 Author Share Posted June 2, 2009 Cheers, thanks for that. I've had a go at some of the different methods but the bit I'm struggling with is making it output a new file with the filtered data ONLY. I know we can use XSLT to have it DISPLAY certain data in a certain way, but the original XML data remains the same, which is not what I want. Link to comment https://forums.phpfreaks.com/topic/160626-xpath-and-php/#findComment-848058 Share on other sites More sharing options...
Maq Posted June 2, 2009 Share Posted June 2, 2009 Can you post your XSL sheet? The reason is probably because you're not applying templates inside a result document. Link to comment https://forums.phpfreaks.com/topic/160626-xpath-and-php/#findComment-848065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.