Union() public static method

public static Union ( NamespaceList o1, NamespaceList o2, bool v1Compat ) : NamespaceList
o1 NamespaceList
o2 NamespaceList
v1Compat bool
return NamespaceList
コード例 #1
0
        internal static XmlSchemaAnyAttribute Union(XmlSchemaAnyAttribute o1, XmlSchemaAnyAttribute o2)
        {
            NamespaceList nsl = NamespaceList.Union(o1.NamespaceList, o2.NamespaceList);

            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);
            }
        }
コード例 #2
0
ファイル: contentnode.cs プロジェクト: ydunk/masters
        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);
        }