コード例 #1
0
            public ValidationState AfterAttribute(
                string localName, string ns, XmlReader reader)
            {
                RdpPattern p = state.AttDeriv(
                    localName, ns, null, reader);

                if (p is RdpNotAllowed)
                {
                    return(null);
                }
                return(new ValidationState(p));
            }
コード例 #2
0
        public ICollection GetAttributeLabels(object stateObject)
        {
            ValidationState state      = ToState(stateObject);
            RdpPattern      p          = state.Pattern;
            Hashtable       elements   = new Hashtable();
            Hashtable       attributes = new Hashtable();

            p.GetLabels(elements, attributes);

            if (roughLabelCheck)
            {
                return(attributes.Values);
            }

            // Strict check that tries actual validation that will
            // cover rejection by notAllowed.
            if (strictCheckCache == null)
            {
                strictCheckCache = new ArrayList();
            }
            else
            {
                strictCheckCache.Clear();
            }
            foreach (XmlQualifiedName qname in attributes.Values)
            {
                if (p.AttDeriv(qname.Name, qname.Namespace, null, this) is RdpNotAllowed)
                {
                    strictCheckCache.Add(qname);
                }
            }
            foreach (XmlQualifiedName qname in strictCheckCache)
            {
                attributes.Remove(qname);
            }
            strictCheckCache.Clear();

            return(attributes.Values);
        }
コード例 #3
0
        /*
         * // attsDeriv :: Context -> Pattern -> [AttributeNode] -> Pattern
         * // [implemented in RdpPattern]
         * internal static RdpPattern AttsDeriv (RdpPattern p, RdpAttributes attributes)
         * {
         *      return p.AttsDeriv (attributes);
         * }
         */

        // attDeriv :: Context -> Pattern -> AttributeNode -> Pattern
        // [all implemented]
        internal static RdpPattern AttDeriv(XmlReader reader,
                                            RdpPattern p, string name, string ns, string value)
        {
            return(p.AttDeriv(name, ns, value, reader));
        }