internal void LoadSchema(XmlElement schemaRoot, DataSet ds)
{
if (schemaRoot == null)
return;
_schemaRoot = schemaRoot;
_ds = ds;
_schemaName = schemaRoot.GetAttribute(Keywords.NAME);
_schemaUri = string.Empty;
Debug.Assert(FEqualIdentity(schemaRoot, Keywords.XDR_SCHEMA, Keywords.XDRNS), "Illegal node");
// Get Locale and CaseSensitive properties
if (_schemaName == null || _schemaName.Length == 0)
_schemaName = "NewDataSet";
ds.Namespace = _schemaUri;
// Walk all the top level Element tags.
for (XmlNode n = schemaRoot.FirstChild; n != null; n = n.NextSibling)
{
if (!(n is XmlElement))
continue;
XmlElement child = (XmlElement)n;
if (FEqualIdentity(child, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS))
{
HandleTable(child);
}
}
_schemaName = XmlConvert.DecodeName(_schemaName);
if (ds.Tables[_schemaName] == null)
ds.DataSetName = _schemaName;
}