private QilNode CompileGroupingSeparatorAttribute(string attValue, bool fwdCompat)
{
QilNode result = CompileStringAvt(attValue);
if (result == null)
{
// NOTE: string.Empty value denotes unspecified attribute
result = _f.String(string.Empty);
}
else if (result.NodeType == QilNodeType.LiteralString)
{
string value = (string)(QilLiteral)result;
if (value.Length != 1)
{
if (!fwdCompat)
{
ReportError(/*[XT_035]*/SR.Xslt_CharAttribute, "grouping-separator");
}
// See the comment above
result = _f.String(string.Empty);
}
}
else
{
QilIterator i = _f.Let(result);
result = _f.Loop(i,
_f.Conditional(_f.Eq(_f.StrLength(i), _f.Int32(1)), i,
fwdCompat ? _f.String(string.Empty) :
_f.Error(_lastScope.SourceLine, SR.Xslt_CharAttribute, "grouping-separator")
));
}
return result;
}