public ValidateEndOfAttributes ( |
||
schemaInfo | ||
return | void |
public void ValidateEndOfAttributes(XmlSchemaInfo schemaInfo)
{
CheckStateTransition(ValidatorState.EndOfAttributes, s_methodNames[(int)ValidatorState.EndOfAttributes]);
//Check required attributes
SchemaElementDecl currentElementDecl = _context.ElementDecl;
if (currentElementDecl != null && currentElementDecl.HasRequiredAttribute)
{
_context.CheckRequiredAttribute = false;
CheckRequiredAttributes(currentElementDecl);
}
if (schemaInfo != null)
{ //set validity depending on whether all required attributes were validated successfully
schemaInfo.Validity = _context.Validity;
}
}
public void DefaultValueForXmlResolver_XmlUrlResolver() { XmlNamespaceManager manager = new XmlNamespaceManager(new NameTable()); manager.AddNamespace("t", "uri:tempuri"); XmlSchemaValidator val = new XmlSchemaValidator(new NameTable(), CreateSchemaSetFromXml("<root />"), manager, AllFlags); XmlSchemaInfo info = new XmlSchemaInfo(); val.XmlResolver = new XmlUrlResolver(); //Adding this as the default resolver is null and not XmlUrlResolver anymore val.Initialize(); val.ValidateElement("foo", "", null, "t:type1", null, "uri:tempuri " + TestData + XSDFILE_TARGET_NAMESPACE, null); val.ValidateEndOfAttributes(null); val.ValidateElement("bar", "", null); val.ValidateEndOfAttributes(null); val.ValidateEndElement(null); val.ValidateEndElement(info); Assert.Equal(info.ContentType, XmlSchemaContentType.ElementOnly); Assert.True(info.SchemaType != null); return; }