private static void getTextLex(string avt, ref int start, StringBuilder lex)
{
Debug.Assert(avt.Length != start, "Empty string not supposed here");
Debug.Assert(lex.Length == 0, "Builder shoud to be reset here");
int avtLength = avt.Length;
int i;
for (i = start; i < avtLength; i++)
{
char ch = avt[i];
if (ch == '{')
{
if (i + 1 < avtLength && avt[i + 1] == '{')
{ // "{{"
i++;
}
else
{
break;
}
}
else if (ch == '}')
{
if (i + 1 < avtLength && avt[i + 1] == '}')
{ // "}}"
i++;
}
else
{
throw XsltException.Create(SR.Xslt_SingleRightAvt, avt);
}
}
lex.Append(ch);
}
start = i;
}