internal ConfigurationElementSchema FindSchema(string path)
{
var index = path.IndexOf(Path, StringComparison.Ordinal);
if (index != 0)
{
return null;
}
if (this.Path.Length != 0)
{
if (path.Length != this.Path.Length && path[this.Path.Length] != '/')
{
return null;
}
}
if (path == Path)
{
return this;
}
foreach (ConfigurationElementSchema child in ChildElementSchemas)
{
var result = child.FindSchema(path);
if (result != null)
{
return result;
}
}
return this.CollectionSchema?.FindSchema(path);
}
}