i’ve had a look around, apologies if i’ve duplicated this question
i have a standard list
i.e.
List<String> WordsRequested = new List<String>();
I need to return an XPathNodeIterator of this list
What would be the most efficient way to perform this conversion?
E.G. in pseudo code
XMlDocument xd = new XmlDocument("<WordsRequested></WordsRequested>");
//imaginary method to add each string as a <Word/> Element
xd.Append(WordsRequested, "Word");
XPathNodeIterator xpni = xd.Select("//WordsRequest/Word");
return xpni;
I am returning this to an XSLTExtension in Umbraco
Since you are using Umbraco, you can make use of the ‘umbraco.library.Split’ method. This will take a delimited string and return an XPathNodeIterator.
An example XSLT extension would be like this: