private QilNode CompileLangAttribute(string attValue, bool fwdCompat)
{
QilNode result = CompileStringAvt(attValue);
if (result == null)
{
// Do nothing
}
else if (result.NodeType == QilNodeType.LiteralString)
{
string lang = (string)(QilLiteral)result;
string cultName = XsltLibrary.LangToNameInternal(lang, fwdCompat, (IErrorHelper)this);
if (cultName == XsltLibrary.InvariantCultureName)
{
result = null;
}
}
else
{
// NOTE: We should have the same checks for both compile time and execution time
QilIterator i;
result = _f.Loop(i = _f.Let(result),
_f.Conditional(_f.Eq(_f.InvokeLangToLcid(i, fwdCompat), _f.Int32(XsltLibrary.InvariantCultureLcid)),
_f.String(string.Empty),
i
)
);
}
return result;
}