本文整理匯總了C#中System.Xml.Xsl.XsltOld.Compiler.AddAttributeSet方法的典型用法代碼示例。如果您正苦於以下問題:C# Compiler.AddAttributeSet方法的具體用法?C# Compiler.AddAttributeSet怎麽用?C# Compiler.AddAttributeSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Xsl.XsltOld.Compiler
的用法示例。
在下文中一共展示了Compiler.AddAttributeSet方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CompileTopLevelElements
protected void CompileTopLevelElements(Compiler compiler) {
// Navigator positioned at parent root, need to move to child and then back
if (compiler.Recurse() == false) {
return;
}
NavigatorInput input = compiler.Input;
bool notFirstElement = false;
do {
switch (input.NodeType) {
case XPathNodeType.Element:
string name = input.LocalName;
string nspace = input.NamespaceURI;
if (Ref.Equal(nspace, input.Atoms.UriXsl)) {
if (Ref.Equal(name, input.Atoms.Import)) {
if (notFirstElement) {
throw XsltException.Create(Res.Xslt_NotFirstImport);
}
// We should compile imports in reverse order after all toplevel elements.
// remember it now and return to it in CompileImpoorts();
Uri uri = compiler.ResolveUri(compiler.GetSingleAttribute(compiler.Input.Atoms.Href));
string resolved = uri.ToString();
if (compiler.IsCircularReference(resolved)) {
throw XsltException.Create(Res.Xslt_CircularInclude, resolved);
}
compiler.CompiledStylesheet.Imports.Add(uri);
CheckEmpty(compiler);
}
else if (Ref.Equal(name, input.Atoms.Include)) {
notFirstElement = true;
CompileInclude(compiler);
}
else {
notFirstElement = true;
compiler.PushNamespaceScope();
if (Ref.Equal(name, input.Atoms.StripSpace)) {
CompileSpace(compiler, false);
}
else if (Ref.Equal(name, input.Atoms.PreserveSpace)) {
CompileSpace(compiler, true);
}
else if (Ref.Equal(name, input.Atoms.Output)) {
CompileOutput(compiler);
}
else if (Ref.Equal(name, input.Atoms.Key)) {
CompileKey(compiler);
}
else if (Ref.Equal(name, input.Atoms.DecimalFormat)) {
CompileDecimalFormat(compiler);
}
else if (Ref.Equal(name, input.Atoms.NamespaceAlias)) {
CompileNamespaceAlias(compiler);
}
else if (Ref.Equal(name, input.Atoms.AttributeSet)) {
compiler.AddAttributeSet(compiler.CreateAttributeSetAction());
}
else if (Ref.Equal(name, input.Atoms.Variable)) {
VariableAction action = compiler.CreateVariableAction(VariableType.GlobalVariable);
if (action != null) {
AddAction(action);
}
}
else if (Ref.Equal(name, input.Atoms.Param)) {
VariableAction action = compiler.CreateVariableAction(VariableType.GlobalParameter);
if (action != null) {
AddAction(action);
}
}
else if (Ref.Equal(name, input.Atoms.Template)) {
compiler.AddTemplate(compiler.CreateTemplateAction());
}
else {
if (!compiler.ForwardCompatibility) {
throw compiler.UnexpectedKeyword();
}
}
compiler.PopScope();
}
}
#if !DISABLE_XSLT_SCRIPT
else if (nspace == input.Atoms.UrnMsxsl && name == input.Atoms.Script) {
AddScript(compiler);
}
#endif
else {
if (nspace.Length == 0) {
throw XsltException.Create(Res.Xslt_NullNsAtTopLevel, input.Name);
}
// Ignoring non-recognized namespace per XSLT spec 2.2
}
break;
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Comment:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
break;
default:
//.........這裏部分代碼省略.........