Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have a related links datatype on a document.
In c# i want to loop other the items added to the related links property, so they can be added to an xml output used in a /base call.
My code so far.
string xml = @"<pages xmlns=""dt"" xmlns:dt=""dt"">";Document doc = new Document(mainid);if (doc.HasChildren){ Document[] children = doc.Children; foreach (Document childDoc in children) { string PropertyData = uQuery.GetDocument(childDoc.Id).GetProperty<string>("checkboxOptions"); //the below seems to be empty Property PropertyDataLinks = childDoc.getProperty("relatedLinks"); xml += "<page title=\"" + childDoc.Text + "\" nodeid=\"" + childDoc.Id + "\">"; foreach (var line in PropertyData.Split('\n')) { xml += "<node>" + line.TrimEnd() + "</node>"; } //this isnt generating an output XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(new StringReader(PropertyDataLinks)); XmlNodeList nodeList = xmlDoc.SelectNodes("/links/link"); foreach (XmlNode node in nodeList) { xml += "<links>" + node.Name + "</links>"; } xml += "</page>"; }}xml += "</pages>";
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Related links loop
Hi,
I have a related links datatype on a document.
In c# i want to loop other the items added to the related links property, so they can be added to an xml output used in a /base call.
My code so far.
is working on a reply...