Ejemplo n.º 1
0
        private QuickFix[] GetInsertFixes(XmlElement e)
        {
            if (e == null)
            {
                return new QuickFix[] {}
            }
            ;

            XmlElement parent = e.ParentNode as XmlElement;

            // TODO: E: entities!
            if (parent == null)
            {
                return new QuickFix[] {}
            }
            ;

            ValidationEngine ve = new ValidationEngine(documentType, null);

            // get candidate replacements
            ElementListItem[] possibles = ve.GetValidElements(parent, e, false);

            ArrayList ret = new ArrayList();

            foreach (ElementListItem eli in possibles)
            {
                if (eli.IsRequired)
                {
                    QuickFixInsert qfi = new QuickFixInsert(e, eli.Name);
                    ret.Add(qfi);
                }
            }
            return(ret.ToArray(typeof(QuickFix)) as QuickFix[]);
        }
Ejemplo n.º 2
0
        private QuickFix[] GetInsertFixes(XmlElement e)
        {
            if ( e == null )
                return new QuickFix[] {};

            XmlElement parent=e.ParentNode as XmlElement;
            // TODO: E: entities!
            if ( parent == null )
                return new QuickFix[] {};

            ValidationEngine ve=new ValidationEngine(documentType, null);
            // get candidate replacements
            ElementListItem[] possibles=ve.GetValidElements(parent, e, false);

            ArrayList ret=new ArrayList();
            foreach ( ElementListItem eli in possibles )
            {
                if ( eli.IsRequired )
                {
                    QuickFixInsert qfi=new QuickFixInsert(e, eli.Name);
                    ret.Add(qfi);
                }
            }
            return ret.ToArray(typeof(QuickFix)) as QuickFix[];
        }