May 15, 2015 04:34 AM|mantaii|LINK
I'm creating a new XML document and as part of doing this I need to create a new XElement named tag with an XAttribute called ref which has a value given to it from stringTags
I can do this for 1 item but in some cases I need to add multiple.
What I have so far is:
new XAttribute("ref", stringTags))
But what I need is something like
foreach (string element in list)
new XAttribute("ref", stringTags)
But this doesn't work.
Can anyone suggest a way of doing this - the foreach loop gives me to correct output when I place it outwith the creation of the XML doc.