protected internal String ApplyRules(String uri, Stack<GroupEntry> catalogs)
{
if (uri.StartsWith ("-//") || uri.StartsWith ("urn:public:"))
return (ApplyRules (uri, null, catalogs));
String result = null;
if (catalogs.Contains (this))
throw new Exception ("Circular dependency in the XML Catalogs");
catalogs.Push (this);
if ((uri != null) && (uri.Length > 0)) {
if ((result = ApplyUriEntries (uri, catalogs)) != null) {
catalogs.Pop ();
return (result);
}
if ((result = ApplyRewriteUriEntries (uri, catalogs)) != null) {
catalogs.Pop ();
return (result);
}
if ((result = ApplyDelegateUriEntries (uri, catalogs)) != null) {
catalogs.Pop ();
return (result);
}
}
// Finally try any other chained catalogs
if ((result = ApplyNextCatalogEntries (uri, catalogs)) != null) {
catalogs.Pop ();
return (result);
}
catalogs.Pop ();
return (null);
}