private void LoadNamespaceAlias(NsDecl stylesheetNsList)
{
ContextInfo ctxInfo = _input.GetAttributes(_namespaceAliasAttributes);
ctxInfo.nsList = MergeNamespaces(ctxInfo.nsList, stylesheetNsList);
string stylesheetNsUri = null;
string resultPrefix = null;
string resultNsUri = null;
if (_input.MoveToXsltAttribute(0, "stylesheet-prefix"))
{
if (_input.Value.Length == 0)
{
ReportError(/*[XT_005]*/SR.Xslt_EmptyNsAlias, "stylesheet-prefix");
}
else
{
stylesheetNsUri = _input.LookupXmlNamespace(_input.Value == "#default" ? string.Empty : _input.Value);
}
}
if (_input.MoveToXsltAttribute(1, "result-prefix"))
{
if (_input.Value.Length == 0)
{
ReportError(/*[XT_005]*/SR.Xslt_EmptyNsAlias, "result-prefix");
}
else
{
resultPrefix = _input.Value == "#default" ? string.Empty : _input.Value;
resultNsUri = _input.LookupXmlNamespace(resultPrefix);
}
}
CheckNoContent();
if (stylesheetNsUri == null || resultNsUri == null)
{
// At least one of attributes is missing or invalid
return;
}
if (_compiler.SetNsAlias(stylesheetNsUri, resultNsUri, resultPrefix, _curStylesheet.ImportPrecedence))
{
// Namespace alias redefinition
_input.MoveToElement();
ReportWarning(/*[XT0810]*/SR.Xslt_DupNsAlias, stylesheetNsUri);
}
}