internal void CompileKey(Compiler compiler){
NavigatorInput input = compiler.Input;
string element = input.LocalName;
int MatchKey = Compiler.InvalidQueryKey;
int UseKey = Compiler.InvalidQueryKey;
XmlQualifiedName Name = null;
if (input.MoveToFirstAttribute()) {
do {
string nspace = input.NamespaceURI;
string name = input.LocalName;
string value = input.Value;
if (! Keywords.Equals(nspace, input.Atoms.Empty)) continue;
if (Keywords.Equals(name, input.Atoms.Name)) {
Name = compiler.CreateXPathQName(value);
}
else if (Keywords.Equals(name, input.Atoms.Match)) {
MatchKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/true);
}
else if (Keywords.Equals(name, input.Atoms.Use)) {
UseKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/false);
}
else {
if (! compiler.ForwardCompatibility) {
throw XsltException.Create(Res.Xslt_InvalidAttribute, name, element);
}
}
}
while(input.MoveToNextAttribute());
input.ToParent();
}
CheckRequiredAttribute(compiler, MatchKey != Compiler.InvalidQueryKey, Keywords.s_Match);
CheckRequiredAttribute(compiler, UseKey != Compiler.InvalidQueryKey, Keywords.s_Use );
CheckRequiredAttribute(compiler, Name != null , Keywords.s_Name );
compiler.InsertKey(Name, MatchKey, UseKey);
}