private XslNode LoadLiteralResultElement(bool asStylesheet)
{
Debug.Assert(_input.NodeType == XmlNodeType.Element);
string prefix = _input.Prefix;
string name = _input.LocalName;
string nsUri = _input.NamespaceUri;
ContextInfo ctxInfo = _input.GetLiteralAttributes(asStylesheet);
if (_input.IsExtensionNamespace(nsUri))
{
// This is not a literal result element, so drop all attributes we have collected
return SetInfo(f.List(), LoadFallbacks(name), ctxInfo);
}
List<XslNode> content = new List<XslNode>();
for (int i = 1; _input.MoveToLiteralAttribute(i); i++)
{
if (_input.IsXsltNamespace() && _input.IsKeyword(_atoms.UseAttributeSets))
{
AddUseAttributeSets(content);
}
}
for (int i = 1; _input.MoveToLiteralAttribute(i); i++)
{
if (!_input.IsXsltNamespace())
{
XslNode att = f.LiteralAttribute(f.QName(_input.LocalName, _input.NamespaceUri, _input.Prefix), _input.Value, _input.XslVersion);
// QilGenerator takes care of AVTs, and needs line info
AddInstruction(content, SetLineInfo(att, ctxInfo.lineInfo));
}
else
{
// ignore all other xslt attributes. See XslInput.GetLiteralAttributes()
}
}
content = LoadEndTag(LoadInstructions(content));
return SetInfo(f.LiteralElement(f.QName(name, nsUri, prefix)), content, ctxInfo);
}