private string ResolveNonEmptyPrefix(string prefix) { Debug.Assert(_scopeStack != null, "PushScope wasn't called"); Debug.Assert(!string.IsNullOrEmpty(prefix)); if (prefix == "xml") { return(XmlReservedNs.NsXml); } else if (prefix == "xmlns") { return(XmlReservedNs.NsXmlNs); } for (InputScope inputScope = _scopeStack; inputScope != null; inputScope = inputScope.Parent) { string nspace = inputScope.ResolveNonAtom(prefix); if (nspace != null) { return(nspace); } } throw XsltException.Create(SR.Xslt_InvalidPrefix, prefix); }
private string ResolveNonEmptyPrefix(string prefix) { Debug.Assert(this.scopeStack != null, "PushScope wasn't called"); Debug.Assert(prefix != null || prefix.Length != 0); if (prefix == Keywords.s_Xml) { return(Keywords.s_XmlNamespace); } else if (prefix == Keywords.s_Xmlns) { return(Keywords.s_XmlnsNamespace); } for (InputScope inputScope = this.scopeStack; inputScope != null; inputScope = inputScope.Parent) { string nspace = inputScope.ResolveNonAtom(prefix); if (nspace != null) { return(nspace); } } throw XsltException.Create(Res.Xslt_InvalidPrefix, prefix); }