Search the Community
Showing results for tags 'xsl:for-each'.
I've searched through the tutorials etc but all seem to give examples of looping through elements. Also the xml file that I'm trying to use, small and all that it is, isn't perhaps formed the best way anyway but I'm stuck with the format because it is called from a flash swf that cannot be edited. I'm trying to make a simple online form that loads an xml file (using php) to edit 'news' where each newsitem has a headline and then newstext (it also has a newsdate but that is no longer used) Here is an example of the xml and you can see that each element has three attributes.---------<?xml version="1.0" encoding="UTF-8"?><News> <newsItem newsdate="" headline="Some Hotel or Other" itemtxt="Our last appearance here before the new year is on Saturday 18th Dec - etc. etc. " /> <newsItem newsdate="" headline="Headline 2" itemtxt="news item 2 blurb here" /> <newsItem newsdate="" headline="Headline 3" itemtxt="news item 3 blurb here" /> <newsItem newsdate="" headline="Headline 4 " itemtxt="news item 4 blurb here " /></News> I am trying to make an xsl to use in a php form (just like the example on the tutorial) that will show the attributes of these newsitems so they can be edited and saved back to the xml file. I copied the tutorial example using PHP and that worked. However, I've tried editing the example to suit this xml but seen as the example code cycles through elements and not attributes I wasn't very successful and I can't seem to see an example of putting the values that are in quotes up for editing and saving back. Any help much appreciated.Thank you in advance for your time.