18 return context.InputNode.Name ==
"bs:template";
24 HtmlAttribute? pathAttribute = context.
InputNode.Attributes[
"path"];
25 HtmlAttribute? modelAttribute = context.
InputNode.Attributes[
"model"];
27 if (pathAttribute ==
null)
31 "Missing 'path' attribute in 'bs:template' node",
36 string? model = modelAttribute?.Value;
38 if (
string.IsNullOrEmpty(model))
40 Console.WriteLine(
"Missing 'model' attribute in 'bs:template' node");
43 string? path = pathAttribute.Value;
45 if (
string.IsNullOrEmpty(path))
49 "Empty 'path' attribute in 'bs:template' node",
59 context.
InputNode.AppendChildren(res.DocumentNode.ChildNodes);
Implements the Html Context for the Transformation Process.
IFileSystem FileSystem
The Filesystem of the Current Template Context.
BadSourcePosition CreateAttributePosition(HtmlAttribute attribute)
Creates the Source Position of the specified Attribute.
readonly BadHtmlTemplateOptions Options
The Html Template Options.
BadSourcePosition CreateOuterPosition()
Creates the Source Position of the current Input Nodes Outer Content.
readonly HtmlNode InputNode
The Current Input Node.
readonly BadExecutionContext ExecutionContext
The Execution Context that is used to evaluate badscript code.
BadObject ParseAndExecuteSingle(string code, BadSourcePosition pos)
Parses and executes the specified code and returns the result of the last expression.
Implements a Html Template.
static BadHtmlTemplate Create(string file, IFileSystem? fileSystem=null)
Creates a new Template.
HtmlDocument RunTemplate(object? model=null, BadHtmlTemplateOptions? options=null, BadScope? caller=null)
Runs the Template with the specified arguments.
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
The Base Class for all BadScript Objects.
Contains the Error Objects for the BadScript2 Language.
Contains the Runtime Objects.