Intersection() public static méthode

public static Intersection ( NamespaceList o1, NamespaceList o2, bool v1Compat ) : NamespaceList
o1 NamespaceList
o2 NamespaceList
v1Compat bool
Résultat NamespaceList
Exemple #1
0
        internal static XmlSchemaAnyAttribute Intersection(XmlSchemaAnyAttribute o1, XmlSchemaAnyAttribute o2)
        {
            NamespaceList nsl = NamespaceList.Intersection(o1.NamespaceList, o2.NamespaceList);

            if (nsl != null)
            {
                XmlSchemaAnyAttribute anyAttribute = new XmlSchemaAnyAttribute();
                anyAttribute.namespaceList = nsl;
                if (o1.processContents == XmlSchemaContentProcessing.Strict ||
                    o1.processContents == XmlSchemaContentProcessing.None ||
                    o2.processContents == XmlSchemaContentProcessing.Strict ||
                    o2.processContents == XmlSchemaContentProcessing.None)
                {
                    anyAttribute.processContents = XmlSchemaContentProcessing.Strict;
                }
                else if (o1.processContents == XmlSchemaContentProcessing.Lax ||
                         o2.processContents == XmlSchemaContentProcessing.Lax)
                {
                    anyAttribute.processContents = XmlSchemaContentProcessing.Lax;
                }
                else
                {
                    anyAttribute.processContents = XmlSchemaContentProcessing.Skip;
                }
                anyAttribute.Annotation = o1.Annotation;
                return(anyAttribute);
            }
            else
            {
                // not expressible
                return(null);
            }
        }
        internal static XmlSchemaAnyAttribute Intersection(XmlSchemaAnyAttribute o1, XmlSchemaAnyAttribute o2, bool v1Compat)
        {
            NamespaceList nsl = NamespaceList.Intersection(o1.NamespaceList, o2.NamespaceList, v1Compat);

            if (nsl != null)
            {
                XmlSchemaAnyAttribute anyAttribute = new XmlSchemaAnyAttribute();
                anyAttribute.namespaceList   = nsl;
                anyAttribute.ProcessContents = o1.ProcessContents;
                anyAttribute.Annotation      = o1.Annotation;
                return(anyAttribute);
            }
            else
            {
                // not expressible
                return(null);
            }
        }
Exemple #3
0
        private void Join(ArrayList terminalNodes, BitSet lset, NamespaceList lany, BitSet rset, NamespaceList rany, out BitSet set, out NamespaceList any)
        {
            if (lset != null)
            {
                if (rset != null)
                {
                    set = lset.Clone();
                    set.And(rset);
                    if (!set.IsEmpty)
                    {
                        goto error;
                    }
                    set.Or(lset);
                    set.Or(rset);
                }
                else
                {
                    set = lset;
                }
            }
            else
            {
                set = rset;
            }

            if (lany != null)
            {
                if (rany != null)
                {
                    NamespaceList list = NamespaceList.Intersection(rany, lany);
                    if (list == null || list.IsEmpty())
                    {
                        any = NamespaceList.Union(rany, lany);
                    }
                    else
                    {
                        goto error;
                    }
                }
                else
                {
                    any = lany;
                }
            }
            else
            {
                any = rany;
            }

            if (any != null && set != null)
            {
                for (int i = 0; i < set.Count; i++)
                {
                    if (set.Get(i) && any.Allows(((TerminalNode)terminalNodes[i]).Name))
                    {
                        goto error;
                    }
                }
            }
            return;

error:
            throw new XmlSchemaException(Res.Sch_NonDeterministicAny);
        }