Last post Nov 11, 2010 02:55 PM by mchinta
Nov 10, 2010 10:43 AM|mchinta|LINK
I have following code
XmlNodeList emptyNodes = source.SelectNodes(@"//*[not(node())]");
for (int i = emptyNodes.Count - 1; i > -1; i--)
Type t = emptyNodes[i].GetType();
ToBeRemovedNodes = emptyNodes[i];
I need to get Data Type of each and every emptyNodes. If its int I need to insert -1, string i need to insert NULL
So how can i read data Types of empty nodes in XML ?
Nov 10, 2010 06:08 PM|sansan|LINK
If you have any attributes for the node, probably you can check for some conditions for the attribute values and decide if the node is a text or int. And the value is empty, it may not be possible to find the NodeType.
Nov 11, 2010 07:43 AM|Martin_Honnen|LINK
In the DOM model nodes do not have any types like int or string so it is not clear what you are looking for. What determines the type in your view? Do you have a schema?
Nov 11, 2010 02:55 PM|mchinta|LINK
Yes I do have a schema. I guess I cant get type from XML, since type is defeined in Schema.