static private IsDocumentElementTable ( |
||
top | ||
ignoredNamespaces | ||
return | bool |
internal static bool IsDocumentElementTable (XmlElement top,
ArrayList ignoredNamespaces)
{
foreach (XmlAttribute attr in top.Attributes) {
if (attr.NamespaceURI == XmlConstants.XmlnsNS
#if NET_2_0
|| attr.NamespaceURI == XmlConstants.XmlNS
#endif
)
continue;
if (ignoredNamespaces != null &&
ignoredNamespaces.Contains (attr.NamespaceURI))
continue;
// document element has attributes other than xmlns
return true;
}
Hashtable existingTables = new Hashtable ();
foreach (XmlNode n in top.ChildNodes) {
XmlElement el = n as XmlElement;
if (el == null)
continue;
if (GetElementMappingType (el, ignoredNamespaces,
existingTables)
== ElementMappingType.Simple)
return true;
}
return false;
}
XmlDataInferenceLoader::IsDocumentElementTable ( ) : bool |
private bool IsTopLevelDataSet() { string local = XmlHelper.Decode(reader.LocalName); // No need to check DataSetName. In fact, it is ignored. DataTable dt = dataset.Tables [local]; if (dt == null) { return(true); } XmlDocument doc = new XmlDocument(); XmlElement el = (XmlElement)doc.ReadNode(reader); doc.AppendChild(el); reader = new XmlNodeReader(el); reader.MoveToContent(); return(!XmlDataInferenceLoader.IsDocumentElementTable( el, null)); }