Ejemplo n.º 1
0
        public bool VerifyRoleReference(string xsdFile, string uri)
        {
            RoleRef rr = roleRefs[uri] as RoleRef;

            if (rr == null)
            {
                return(false);
            }

            try
            {
                return(string.Compare(xsdFile, rr.GetSchemaName(), true) == 0);
            }
            catch (AucentException)
            {
                return(false);
            }
            catch (ArgumentNullException)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public void LoadRoleRefs(Dictionary <string, string> discoveredSchemas, out int numErrors)
        {
            numErrors = 0;

            XmlNodeList rolesList = theDocument.SelectNodes(RREF_KEY, theManager);

            if (rolesList == null)
            {
                return;
            }


            foreach (XmlNode role in rolesList)
            {
                if (roleRefs == null)
                {
                    roleRefs = new Hashtable();
                }
                string uri  = string.Empty;
                string href = string.Empty;

                if (!Common.GetAttribute(role, HREF_TAG, ref href, errorList) ||
                    !Common.GetAttribute(role, RURI_TAG, ref uri, errorList))
                {
                    ++numErrors;
                    continue;
                }

                RoleRef rr = new RoleRef(href, uri);
                roleRefs[uri] = rr;


                string xsdName = rr.GetSchemaName();
                LinkBase.AddDiscoveredSchema(this.schemaPath, xsdName, discoveredSchemas);
            }
        }
Ejemplo n.º 3
0
        public void LoadRoleRefs( Dictionary<string, string> discoveredSchemas, out int numErrors)
        {
            numErrors = 0;

            XmlNodeList rolesList = theDocument.SelectNodes(RREF_KEY, theManager);

            if (rolesList == null )
            {
                return;
            }

            foreach (XmlNode role in rolesList)
            {
                if (roleRefs == null)
                {
                    roleRefs = new Hashtable();
                }
                string uri = string.Empty;
                string href = string.Empty;

                if (!Common.GetAttribute(role, HREF_TAG, ref href, errorList) ||
                    !Common.GetAttribute(role, RURI_TAG, ref uri, errorList))
                {
                    ++numErrors;
                    continue;
                }

                RoleRef rr = new RoleRef(href, uri);
                roleRefs[uri] = rr;

                string xsdName = rr.GetSchemaName();
                LinkBase.AddDiscoveredSchema(this.schemaPath, xsdName, discoveredSchemas);

            }
        }