"ghost nodes" in content.Instance.XmlContent.CreateNavigator();
Hi,
How can it be that the content.Instance.XmlContent.CreateNavigator returns nodes that doesn't exist anymore? I want to retreive orderlines for a specific order in my usercontrol. For this I've written a method called "GetNodes", given the following parameters:
So when I execute: GetNodes("OrderItemDoctype", "@parentID", 1000).Select(orderitem => new OrderItem(orderitem.Id)).ToList();
I should retreive all the orderlines for order with an id equal to 1000. In the backend order 1000 doesn't have any orderlines. But when I execute the method, it returns orderlines which I deleted a time ago.
Any help would we appreciated!
Below is my method:
public static IEnumerable<Node> GetNodes(string docType, string property, int propertyValue) { var nodes = new Collection<Node>(); var xpn = content.Instance.XmlContent.CreateNavigator(); var xpni = xpn.Select("//" + docType + " [" + property + " = " + propertyValue + "]"); while (xpni.MoveNext()) { var node = xpni.Current; if (node == null) continue; var attribute = node.GetAttribute("id", ""); if (ValidationHelper.IsNumeric(attribute)) {
} } return nodes; }
var n = new Node(Convert.ToInt32(attribute)); nodes.Add(n);
"ghost nodes" in content.Instance.XmlContent.CreateNavigator();
Hi,
How can it be that the content.Instance.XmlContent.CreateNavigator returns nodes that doesn't exist anymore?
I want to retreive orderlines for a specific order in my usercontrol. For this I've written a method called "GetNodes", given the following parameters:
* propertyValue = an orderid
* property = "@parentID"
* docType = "OrderItemDoctype"
So when I execute:
GetNodes("OrderItemDoctype", "@parentID", 1000).Select(orderitem => new OrderItem(orderitem.Id)).ToList();
I should retreive all the orderlines for order with an id equal to 1000. In the backend order 1000 doesn't have any orderlines. But when I execute the method, it returns orderlines which I deleted a time ago.
Any help would we appreciated!
Below is my method:
is working on a reply...