System.Xml.Schema.XmlSchemaValidator.ValidateAttribute C# (CSharp) Méthode

ValidateAttribute() public méthode

public ValidateAttribute ( string localName, string namespaceUri, XmlValueGetter attributeValue, XmlSchemaInfo schemaInfo ) : object
localName string
namespaceUri string
attributeValue XmlValueGetter
schemaInfo XmlSchemaInfo
Résultat object
        public object ValidateAttribute(string localName, string namespaceUri, XmlValueGetter attributeValue, XmlSchemaInfo schemaInfo)
        {
            if (attributeValue == null)
            {
                throw new ArgumentNullException(nameof(attributeValue));
            }
            return ValidateAttribute(localName, namespaceUri, attributeValue, null, schemaInfo);
        }

Same methods

XmlSchemaValidator::ValidateAttribute ( string localName, string namespaceUri, XmlValueGetter attributeValueGetter, string attributeStringValue, XmlSchemaInfo schemaInfo ) : object
XmlSchemaValidator::ValidateAttribute ( string localName, string namespaceUri, string attributeValue, XmlSchemaInfo schemaInfo ) : object

Usage Example

		public void XsdAnyToSkipAttributeValidation ()
		{
			// bug #358408
			XmlSchemaSet schemas = new XmlSchemaSet ();
			schemas.Add (null, "Test/XmlFiles/xsd/358408.xsd");
			XmlSchemaValidator v = new XmlSchemaValidator (
				new NameTable (),
				schemas,
				new XmlNamespaceManager (new NameTable ()),
				XmlSchemaValidationFlags.ProcessIdentityConstraints);
			v.Initialize ();
			v.ValidateWhitespace (" ");
			XmlSchemaInfo info = new XmlSchemaInfo ();
			ArrayList list = new ArrayList ();

			v.ValidateElement ("configuration", "", info, null, null, null, null);
			v.GetUnspecifiedDefaultAttributes (list);
			v.ValidateEndOfAttributes (info);

			v.ValidateWhitespace (" ");

			v.ValidateElement ("host", "", info, null, null, null, null);
			v.ValidateAttribute ("auto-start", "", "true", info);
			list.Clear ();
			v.GetUnspecifiedDefaultAttributes (list);
			v.ValidateEndOfAttributes (info);
			v.ValidateEndElement (null);//info);

			v.ValidateWhitespace (" ");

			v.ValidateElement ("service-managers", "", info, null, null, null, null);
			list.Clear ();
			v.GetUnspecifiedDefaultAttributes (list);
			v.ValidateEndOfAttributes (info);

			v.ValidateWhitespace (" ");

			v.ValidateElement ("service-manager", "", info, null, null, null, null);
			list.Clear ();
			v.GetUnspecifiedDefaultAttributes (list);
			v.ValidateEndOfAttributes (info);

			v.ValidateWhitespace (" ");

			v.ValidateElement ("foo", "", info, null, null, null, null);
			v.ValidateAttribute ("bar", "", "", info);
		}
All Usage Examples Of System.Xml.Schema.XmlSchemaValidator::ValidateAttribute