HandCoded.Xml.Resolver.GroupEntry.ApplyRules C# (CSharp) Method

ApplyRules() protected method

Implements OASIS search rules for URI based resources.
protected ApplyRules ( String uri, Stack catalogs ) : String
uri String The URI of the required resource.
catalogs Stack A stack of catalogs being processed used to /// detect circular dependency.
return String
        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);
        }

Same methods

GroupEntry::ApplyRules ( String publicId, String systemId, Stack catalogs ) : String