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 (nspace.Length != 0)
{
continue;
}
if (Ref.Equal(name, input.Atoms.Name))
{
Name = compiler.CreateXPathQName(value);
}
else if (Ref.Equal(name, input.Atoms.Match))
{
MatchKey = compiler.AddQuery(value, /*allowVars:*/ false, /*allowKey*/ false, /*pattern*/ true);
}
else if (Ref.Equal(name, input.Atoms.Use))
{
UseKey = compiler.AddQuery(value, /*allowVars:*/ false, /*allowKey*/ false, /*pattern*/ false);
}
else
{
if (!compiler.ForwardCompatibility)
{
throw XsltException.Create(SR.Xslt_InvalidAttribute, name, element);
}
}
}while (input.MoveToNextAttribute());
input.ToParent();
}
CheckRequiredAttribute(compiler, MatchKey != Compiler.InvalidQueryKey, "match");
CheckRequiredAttribute(compiler, UseKey != Compiler.InvalidQueryKey, "use");
CheckRequiredAttribute(compiler, Name != null, "name");
// It is a breaking change to check for emptiness, SQLBUDT 324364
//CheckEmpty(compiler);
compiler.InsertKey(Name, MatchKey, UseKey);
}