private void ElementIdentityConstraints () {
for (int i = this.startIDConstraint; i < this.validationStack.Length; i ++) {
// no constraint for this level
if (((ValidationState)(this.validationStack[i])).Constr == null) {
continue;
}
// else
foreach (ConstraintStruct conuct in ((ValidationState)(this.validationStack[i])).Constr) {
// check selector from here
if (conuct.axisSelector.MoveToStartElement(reader.LocalName, reader.NamespaceURI)) {
// selector selects new node, activate a new set of fields
Debug.WriteLine("Selector Match!");
Debug.WriteLine("Name: " + reader.LocalName + "\t|\tURI: " + reader.NamespaceURI + "\n");
// in which axisFields got updated
conuct.axisSelector.PushKS(PositionInfo.LineNumber, PositionInfo.LinePosition);
}
// axisFields is not null, but may be empty
foreach (LocatedActiveAxis laxis in conuct.axisFields) {
// check field from here
if (laxis.MoveToStartElement(reader.LocalName, reader.NamespaceURI)) {
Debug.WriteLine("Element Field Match!");
// checking simpleType / simpleContent
if (context.ElementDecl != null) { // nextElement can be null when xml/xsd are not valid
if (context.ElementDecl.Datatype == null) {
SendValidationEvent(Res.Sch_FieldSimpleTypeExpected, reader.LocalName);
}
else {
// can't fill value here, wait till later....
// fill type : xsdType
laxis.isMatched = true;
// since it's simpletyped element, the endchildren will come consequently... don't worry
}
}
}
}
}
}
}