本文整理匯總了C#中System.Xml.Xsl.XsltOld.Compiler.ResolveXmlNamespace方法的典型用法代碼示例。如果您正苦於以下問題:C# Compiler.ResolveXmlNamespace方法的具體用法?C# Compiler.ResolveXmlNamespace怎麽用?C# Compiler.ResolveXmlNamespace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Xsl.XsltOld.Compiler
的用法示例。
在下文中一共展示了Compiler.ResolveXmlNamespace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddScript
private void AddScript(Compiler compiler) {
NavigatorInput input = compiler.Input;
ScriptingLanguage lang = ScriptingLanguage.JScript;
string implementsNamespace = null;
if (input.MoveToFirstAttribute()) {
do {
if (input.LocalName == input.Atoms.Language) {
string langName = input.Value;
if (
String.Compare(langName, "jscript" , StringComparison.OrdinalIgnoreCase) == 0 ||
String.Compare(langName, "javascript", StringComparison.OrdinalIgnoreCase) == 0
) {
lang = ScriptingLanguage.JScript;
} else if (
String.Compare(langName, "c#" , StringComparison.OrdinalIgnoreCase) == 0 ||
String.Compare(langName, "csharp", StringComparison.OrdinalIgnoreCase) == 0
) {
lang = ScriptingLanguage.CSharp;
}
#if !FEATURE_PAL // visualbasic
else if (
String.Compare(langName, "vb" , StringComparison.OrdinalIgnoreCase) == 0 ||
String.Compare(langName, "visualbasic", StringComparison.OrdinalIgnoreCase) == 0
) {
lang = ScriptingLanguage.VisualBasic;
}
#endif // !FEATURE_PAL
else {
throw XsltException.Create(Res.Xslt_ScriptInvalidLanguage, langName);
}
}
else if (input.LocalName == input.Atoms.ImplementsPrefix) {
if(! PrefixQName.ValidatePrefix(input.Value)) {
throw XsltException.Create(Res.Xslt_InvalidAttrValue, input.LocalName, input.Value);
}
implementsNamespace = compiler.ResolveXmlNamespace(input.Value);
}
}
while (input.MoveToNextAttribute());
input.ToParent();
}
if (implementsNamespace == null) {
throw XsltException.Create(Res.Xslt_MissingAttribute, input.Atoms.ImplementsPrefix);
}
if (!input.Recurse() || input.NodeType != XPathNodeType.Text) {
throw XsltException.Create(Res.Xslt_ScriptEmpty);
}
compiler.AddScript(input.Value, lang, implementsNamespace, input.BaseURI, input.LineNumber);
input.ToParent();
}