Black.Beard.Jslt 1.0.337

There is a newer version of this package available.
See the version list below for details.
dotnet add package Black.Beard.Jslt --version 1.0.337                
NuGet\Install-Package Black.Beard.Jslt -Version 1.0.337                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Black.Beard.Jslt" Version="1.0.337" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Black.Beard.Jslt --version 1.0.337                
#r "nuget: Black.Beard.Jslt, 1.0.337"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Black.Beard.Jslt as a Cake Addin
#addin nuget:?package=Black.Beard.Jslt&version=1.0.337

// Install Black.Beard.Jslt as a Cake Tool
#tool nuget:?package=Black.Beard.Jslt&version=1.0.337                

Implementation of jslt language in DOTNET. Use a template for transform Json document to another json document.

The following sample for help you to easy start.


    using Bb;
    using Bb.Json.Jslt.Services;
    using System.Text;

    public static class TemplateHelper
    {

        /// <summary>
        /// Call this method for load anc compile template
        /// </summary>
        /// <param name="file">file that content the template jslt</param>
        /// <param name="withDebug">if true, activate the debug mode</param>
        /// <param name="paths">that for auto detect extended services</param>
        /// <param name="services">add extended services</param>
        /// <returns></returns>
        public static JsltTemplate LoadTemplate(this FileInfo file, bool withDebug, string[] paths, params Type[] services)
        {
            var content = file.FullName.LoadFile();
            StringBuilder sb = new StringBuilder();
            var _template = sb.GetTransformProvider(withDebug, file.FullName, paths, services);
            return _template;
        }

        public static JsltTemplate GetTransformProvider(this StringBuilder sb, bool withDebug, string templatefilename, string[] paths, params Type[] services)
        {
            var provider = GetProvider(paths, services);
            JsltTemplate template = provider.GetTemplate(sb, withDebug, templatefilename);
            return template;
        }

        public static TemplateTransformProvider GetProvider(string[] paths, params Type[] services)
        {

            var configuration = new TranformJsonAstConfiguration();

            // If you haven't added Package "Black.Beard.Jslt.Services" you must comment this line.
            // configuration.Assemblies.Add(typeof(Bb.Jslt.Services.Services).Assembly);

            if (paths != null)
                foreach (var item in paths)
                    if (!string.IsNullOrEmpty(item))
                        configuration.Paths.Add(item);

            foreach (var item in services)
                configuration.Services.ServiceDiscovery.AddService(item);

            TemplateTransformProvider Templateprovider = new TemplateTransformProvider(configuration);

            return Templateprovider;

        }

    }


Now a sample for use template


    var file = new FileInfo(rulePayload);
    file.Refresh();
    if (!file.Exists)
        throw new Exception($"the path '{file}' can't be resolved.");

    // Build template
    var _template = file.LoadTemplate(false, new string[0]);


    // create an instance of sources with no datas
    var src = Sources.GetEmpty();

    // inject data in the model, for accessing by json path '$"
    // var src2 = new Sources(SourceJson.GetFromText("{}"));
    
    // Add a value for for accessing from the template
    src.Variables.Add("My value", new JValue(1));

    // execute template but not apply output directives.
    var ctx = _template.Transform(src);

    // execute template and apply output directives.
    var result = _template.TransformForOutput(src);

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Black.Beard.Jslt:

Package Downloads
Black.Beard.Jslt.Services

support extended method(loading excel, html, multicsv, sql).

Black.Beard.Jslt.Symbol

Implementation of jslt language in DOTNET. Use a template for transform Json document to another json document.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.350 87 5/2/2024
1.0.349 71 5/2/2024
1.0.348 80 5/2/2024
1.0.347 63 5/2/2024
1.0.346 109 4/7/2024
1.0.345 97 4/7/2024
1.0.344 73 4/5/2024
1.0.343 75 4/5/2024
1.0.342 83 4/5/2024
1.0.341 88 4/5/2024
1.0.340 94 4/4/2024
1.0.339 94 4/4/2024
1.0.338 101 4/3/2024
1.0.337 108 4/3/2024
1.0.336 101 4/3/2024
1.0.335 90 4/3/2024
1.0.334 93 4/2/2024
1.0.333 80 4/2/2024
1.0.332 92 4/2/2024
1.0.331 99 4/2/2024
1.0.330 90 4/2/2024
1.0.329 83 4/2/2024
1.0.328 100 4/1/2024
1.0.327 88 4/1/2024
1.0.325 87 4/1/2024
1.0.324 100 4/1/2024
1.0.323 94 4/1/2024
1.0.322 82 3/31/2024
1.0.321 86 3/31/2024
1.0.319 96 3/31/2024
1.0.318 86 3/31/2024
1.0.317 239 3/19/2024
1.0.316 85 3/19/2024
1.0.315 188 3/15/2024
1.0.314 107 3/15/2024
1.0.313 127 3/13/2024
1.0.312 105 3/13/2024
1.0.311 100 3/13/2024
1.0.310 100 3/13/2024
1.0.309 145 3/12/2024
1.0.308 136 3/12/2024
1.0.306 273 3/5/2024
1.0.305 100 3/5/2024
1.0.304 116 3/4/2024
1.0.303 102 3/4/2024
1.0.302 106 3/4/2024
1.0.301 100 3/4/2024
1.0.300 126 3/3/2024
1.0.299 90 3/3/2024
1.0.298 260 2/26/2024
1.0.297 78 2/26/2024
1.0.296 100 2/25/2024
1.0.295 92 2/25/2024
1.0.294 109 2/24/2024
1.0.293 95 2/24/2024
1.0.292 95 2/24/2024
1.0.291 105 2/24/2024
1.0.290 91 2/24/2024
1.0.289 96 2/24/2024
1.0.288 187 2/21/2024
1.0.287 110 2/21/2024
1.0.286 1,801 12/12/2023
1.0.285 103 12/12/2023
1.0.259 1,516 10/17/2023
1.0.258 108 10/17/2023
1.0.257 218 10/13/2023
1.0.256 116 10/13/2023
1.0.255 212 10/10/2023
1.0.254 119 10/10/2023
1.0.253 165 9/19/2023
1.0.252 112 9/19/2023
1.0.251 134 9/13/2023
1.0.250 132 9/13/2023
1.0.245 157 7/26/2023
1.0.244 144 7/26/2023
1.0.243 162 7/19/2023
1.0.242 145 7/19/2023
1.0.241 131 7/11/2023
1.0.240 141 7/11/2023
1.0.239 141 7/7/2023
1.0.238 127 7/7/2023
1.0.237 155 7/6/2023
1.0.236 139 7/6/2023
1.0.235 133 7/6/2023
1.0.234 141 7/6/2023
1.0.232 136 7/5/2023
1.0.231 143 7/5/2023
1.0.230 144 7/5/2023
1.0.229 149 7/5/2023
1.0.228 141 7/5/2023
1.0.227 147 7/5/2023
1.0.226 137 7/4/2023
1.0.225 138 7/4/2023
1.0.224 164 7/3/2023
1.0.223 138 7/3/2023
1.0.222 140 6/30/2023
1.0.221 121 6/30/2023
1.0.220 145 6/30/2023
1.0.219 133 6/30/2023
1.0.218 167 6/17/2023
1.0.217 143 6/17/2023
1.0.214 145 6/6/2023
1.0.213 137 6/6/2023
1.0.212 129 6/6/2023
1.0.211 135 6/6/2023
1.0.206 130 6/5/2023
1.0.205 128 6/5/2023
1.0.204 152 6/2/2023
1.0.203 113 6/2/2023
1.0.202 147 6/2/2023
1.0.201 145 6/2/2023
1.0.190 551 5/27/2022
1.0.189 503 5/27/2022
1.0.188 514 5/23/2022
1.0.187 521 5/23/2022
1.0.186 485 5/18/2022
1.0.185 488 5/18/2022
1.0.184 531 5/18/2022
1.0.183 530 5/18/2022
1.0.182 523 5/17/2022
1.0.181 518 5/17/2022
1.0.180 515 5/11/2022
1.0.179 525 5/11/2022
1.0.178 535 5/6/2022
1.0.177 539 5/6/2022
1.0.176 567 4/2/2022
1.0.175 543 4/2/2022
1.0.174 533 3/24/2022
1.0.173 520 3/24/2022
1.0.172 486 3/23/2022
1.0.171 511 3/23/2022
1.0.170 512 3/23/2022
1.0.169 502 3/23/2022
1.0.168 545 3/21/2022
1.0.167 531 3/21/2022
1.0.166 535 3/19/2022
1.0.165 552 3/19/2022
1.0.164 528 3/17/2022
1.0.163 530 3/17/2022
1.0.162 521 3/17/2022
1.0.161 533 3/17/2022
1.0.160 520 3/16/2022
1.0.159 545 3/16/2022
1.0.158 547 3/7/2022
1.0.157 543 3/7/2022
1.0.156 535 3/6/2022
1.0.155 532 3/6/2022
1.0.154 541 3/6/2022
1.0.153 544 3/6/2022
1.0.152 540 3/6/2022
1.0.151 546 3/6/2022
1.0.150 532 3/6/2022
1.0.149 560 3/6/2022
1.0.148 557 3/5/2022
1.0.147 546 3/5/2022
1.0.146 510 3/5/2022
1.0.145 644 3/5/2022
1.0.144 635 3/5/2022
1.0.143 650 3/5/2022
1.0.142 643 3/5/2022
1.0.140 544 3/5/2022
1.0.139 524 3/5/2022
1.0.137 527 3/5/2022
1.0.136 507 3/5/2022
1.0.135 405 3/5/2022
1.0.134 406 3/5/2022
1.0.133 538 3/5/2022
1.0.132 545 3/5/2022
1.0.131 523 3/5/2022
1.0.130 544 3/5/2022
1.0.128 523 3/5/2022
1.0.126 407 3/5/2022
1.0.125 426 3/4/2022
1.0.124 426 3/4/2022
1.0.123 425 3/4/2022
1.0.122 439 3/4/2022
1.0.120 439 3/4/2022
1.0.119 423 3/4/2022
1.0.118 416 3/3/2022
1.0.117 411 3/3/2022
1.0.116 406 3/3/2022
1.0.115 430 3/3/2022
1.0.114 440 2/21/2022
1.0.113 414 2/21/2022
1.0.112 451 2/19/2022
1.0.111 411 2/18/2022
1.0.110 422 2/18/2022
1.0.109 412 2/18/2022
1.0.107 414 2/17/2022
1.0.106 915 2/17/2022
1.0.105 453 1/18/2022
1.0.104 446 1/18/2022
1.0.103 289 12/20/2021
1.0.102 289 12/20/2021
1.0.101 276 12/20/2021
1.0.100 270 12/20/2021
1.0.99 257 12/20/2021
1.0.98 245 12/20/2021
1.0.96 274 12/18/2021
1.0.94 309 12/18/2021
1.0.93 295 12/18/2021
1.0.92 310 12/18/2021
1.0.0 430 3/5/2022