private void ReadElementContent (DataRow row)
{
switch (reader.NodeType) {
case XmlNodeType.EndElement:
// This happens when the content was only whitespace (and skipped by MoveToContent()).
return;
case XmlNodeType.Element:
ReadElementElement (row);
break;
case XmlNodeType.Text:
case XmlNodeType.CDATA:
case XmlNodeType.SignificantWhitespace:
DataColumn simple = null;
DataColumnCollection cols = row.Table.Columns;
for (int i = 0; i < cols.Count; i++) {
DataColumn col = cols [i];
if (col.ColumnMapping ==
MappingType.SimpleContent) {
simple = col;
break;
}
}
string s = reader.ReadString ();
reader.MoveToContent ();
#if SILLY_MS_COMPATIBLE
// As to MS, "test string" and "test <!-- comment -->string" are different :P
if (simple != null && row.IsNull (simple))
row [simple] = StringToObject (simple.DataType, s);
#else
// But it does not mean we support "123<!-- comment -->456". just allowed for string
if (simple != null)
row [simple] += s;
#endif
break;
case XmlNodeType.Whitespace:
reader.ReadString ();
break;
}
}