private XslNode XslNumber()
{
ContextInfo ctxInfo = _input.GetAttributes(_numberAttributes);
string value = ParseStringAttribute(0, "value");
string select = ParseStringAttribute(1, "select");
if (select != null) ReportNYI("xsl:number/@select");
NumberLevel level = NumberLevel.Single;
if (_input.MoveToXsltAttribute(2, "level"))
{
switch (_input.Value)
{
case "single": level = NumberLevel.Single; break;
case "multiple": level = NumberLevel.Multiple; break;
case "any": level = NumberLevel.Any; break;
default:
if (!_input.ForwardCompatibility)
{
ReportError(/*[XT_022]*/SR.Xslt_InvalidAttrValue, "level", _input.Value);
}
break;
}
}
string count = ParseStringAttribute(3, "count");
string from = ParseStringAttribute(4, "from");
string format = ParseStringAttribute(5, "format");
string lang = ParseStringAttribute(6, "lang");
string letterValue = ParseStringAttribute(7, "letter-value");
string ordinal = ParseStringAttribute(8, "ordinal");
if (!string.IsNullOrEmpty(ordinal)) ReportNYI("xsl:number/@ordinal");
string groupingSeparator = ParseStringAttribute(9, "grouping-separator");
string groupingSize = ParseStringAttribute(10, "grouping-size");
// Default values for xsl:number : level="single" format="1"
if (format == null)
{
format = "1";
}
CheckNoContent();
return SetInfo(
f.Number(level, count, from, value,
format, lang, letterValue, groupingSeparator, groupingSize,
_input.XslVersion
),
null, ctxInfo
);
}