Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompileTopLevelElements()

void System.Xml.Xsl.XsltOld.ContainerAction.CompileTopLevelElements ( Compiler compiler)
inlineprotectedinherited

Definition at line 412 of file ContainerAction.cs.

413 {
414 if (!compiler.Recurse())
415 {
416 return;
417 }
418 NavigatorInput input = compiler.Input;
419 bool flag = false;
420 do
421 {
422 switch (input.NodeType)
423 {
424 case XPathNodeType.Element:
425 {
426 string localName = input.LocalName;
427 string namespaceURI = input.NamespaceURI;
428 if (Ref.Equal(namespaceURI, input.Atoms.UriXsl))
429 {
430 if (Ref.Equal(localName, input.Atoms.Import))
431 {
432 if (flag)
433 {
434 throw XsltException.Create(System.SR.Xslt_NotFirstImport);
435 }
436 Uri uri = compiler.ResolveUri(compiler.GetSingleAttribute(compiler.Input.Atoms.Href));
437 string text = uri.ToString();
438 if (compiler.IsCircularReference(text))
439 {
440 throw XsltException.Create(System.SR.Xslt_CircularInclude, text);
441 }
442 compiler.CompiledStylesheet.Imports.Add(uri);
444 break;
445 }
446 if (Ref.Equal(localName, input.Atoms.Include))
447 {
448 flag = true;
450 break;
451 }
452 flag = true;
453 compiler.PushNamespaceScope();
454 if (Ref.Equal(localName, input.Atoms.StripSpace))
455 {
457 }
458 else if (Ref.Equal(localName, input.Atoms.PreserveSpace))
459 {
461 }
462 else if (Ref.Equal(localName, input.Atoms.Output))
463 {
465 }
466 else if (Ref.Equal(localName, input.Atoms.Key))
467 {
469 }
470 else if (Ref.Equal(localName, input.Atoms.DecimalFormat))
471 {
473 }
474 else if (Ref.Equal(localName, input.Atoms.NamespaceAlias))
475 {
477 }
478 else if (Ref.Equal(localName, input.Atoms.AttributeSet))
479 {
480 compiler.AddAttributeSet(compiler.CreateAttributeSetAction());
481 }
482 else if (Ref.Equal(localName, input.Atoms.Variable))
483 {
484 VariableAction variableAction = compiler.CreateVariableAction(VariableType.GlobalVariable);
485 if (variableAction != null)
486 {
488 }
489 }
490 else if (Ref.Equal(localName, input.Atoms.Param))
491 {
492 VariableAction variableAction2 = compiler.CreateVariableAction(VariableType.GlobalParameter);
493 if (variableAction2 != null)
494 {
496 }
497 }
498 else if (Ref.Equal(localName, input.Atoms.Template))
499 {
500 compiler.AddTemplate(compiler.CreateTemplateAction());
501 }
502 else if (!compiler.ForwardCompatibility)
503 {
504 throw compiler.UnexpectedKeyword();
505 }
506 compiler.PopScope();
507 }
508 else if (namespaceURI == input.Atoms.UrnMsxsl && localName == input.Atoms.Script)
509 {
511 }
512 else if (namespaceURI.Length == 0)
513 {
514 throw XsltException.Create(System.SR.Xslt_NullNsAtTopLevel, input.Name);
515 }
516 break;
517 }
518 default:
519 throw XsltException.Create(System.SR.Xslt_InvalidContents, "stylesheet");
520 case XPathNodeType.SignificantWhitespace:
521 case XPathNodeType.Whitespace:
522 case XPathNodeType.ProcessingInstruction:
523 case XPathNodeType.Comment:
524 break;
525 }
526 }
527 while (compiler.Advance());
528 compiler.ToParent();
529 }
static string Xslt_InvalidContents
Definition SR.cs:2076
static string Xslt_NotFirstImport
Definition SR.cs:2072
static string Xslt_NullNsAtTopLevel
Definition SR.cs:1874
static string Xslt_CircularInclude
Definition SR.cs:1890
Definition SR.cs:7
void CompileDecimalFormat(Compiler compiler)
void CompileNamespaceAlias(Compiler compiler)
void CompileSpace(Compiler compiler, bool preserve)

References System.Xml.Xsl.XsltOld.ContainerAction.AddAction(), System.Xml.Xsl.XsltOld.ContainerAction.AddScript(), System.Xml.Xsl.XsltOld.CompiledAction.CheckEmpty(), System.Xml.Xsl.XsltOld.ContainerAction.CompileDecimalFormat(), System.Xml.Xsl.XsltOld.ContainerAction.CompileInclude(), System.Xml.Xsl.XsltOld.ContainerAction.CompileKey(), System.Xml.Xsl.XsltOld.ContainerAction.CompileNamespaceAlias(), System.Xml.Xsl.XsltOld.ContainerAction.CompileOutput(), System.Xml.Xsl.XsltOld.ContainerAction.CompileSpace(), System.Xml.Xsl.XsltException.Create(), System.Xml.Dictionary, System.Xml.Ref.Equal(), System.input, System.Xml.Xsl.XsltOld.NavigatorInput.LocalName, System.text, System.Uri.ToString(), System.SR.Xslt_CircularInclude, System.SR.Xslt_InvalidContents, System.SR.Xslt_NotFirstImport, and System.SR.Xslt_NullNsAtTopLevel.

Referenced by System.Xml.Xsl.XsltOld.ContainerAction.CompileDocument().