System.Xml.Schema.SchemaEntity.IsPredefinedEntity C# (CSharp) Méthode

IsPredefinedEntity() static private méthode

static private IsPredefinedEntity ( String n ) : bool
n String
Résultat bool
        internal static bool IsPredefinedEntity(String n) {
            return(n == "lt" ||
                   n == "gt" ||
                   n == "amp" ||
                   n == "apos" ||
                   n == "quot");
        }

Usage Example

Exemple #1
0
        private bool GenEntity(XmlQualifiedName qname)
        {
            string n = qname.Name;

            if (n[0] == '#')   // char entity reference
            {
                return(false);
            }
            else if (SchemaEntity.IsPredefinedEntity(n))
            {
                return(false);
            }
            else
            {
                SchemaEntity en = GetEntity(qname, false);
                if (en == null)
                {
                    // well-formness error, see xml spec [68]
                    throw new XmlException(Res.Xml_UndeclaredEntity, n);
                }
                if (!en.NData.IsEmpty)
                {
                    // well-formness error, see xml spec [68]
                    throw new XmlException(Res.Xml_UnparsedEntityRef, n);
                }

                if (reader.StandAlone && en.DeclaredInExternal)
                {
                    SendValidationEvent(Res.Sch_StandAlone);
                }
                return(true);
            }
        }
All Usage Examples Of System.Xml.Schema.SchemaEntity::IsPredefinedEntity