Black.Beard.Jslt 1.0.317

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.317
NuGet\Install-Package Black.Beard.Jslt -Version 1.0.317
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.317" />
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.317
#r "nuget: Black.Beard.Jslt, 1.0.317"
#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.317

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

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.346 89 4/7/2024
1.0.345 84 4/7/2024
1.0.344 59 4/5/2024
1.0.343 56 4/5/2024
1.0.342 71 4/5/2024
1.0.341 72 4/5/2024
1.0.340 78 4/4/2024
1.0.339 82 4/4/2024
1.0.338 90 4/3/2024
1.0.337 96 4/3/2024
1.0.336 90 4/3/2024
1.0.335 75 4/3/2024
1.0.334 81 4/2/2024
1.0.333 68 4/2/2024
1.0.332 75 4/2/2024
1.0.331 83 4/2/2024
1.0.330 79 4/2/2024
1.0.329 72 4/2/2024
1.0.328 88 4/1/2024
1.0.327 71 4/1/2024
1.0.325 69 4/1/2024
1.0.324 82 4/1/2024
1.0.323 76 4/1/2024
1.0.322 71 3/31/2024
1.0.321 70 3/31/2024
1.0.319 80 3/31/2024
1.0.318 75 3/31/2024
1.0.317 225 3/19/2024
1.0.316 72 3/19/2024
1.0.315 169 3/15/2024
1.0.314 89 3/15/2024
1.0.313 116 3/13/2024
1.0.312 94 3/13/2024
1.0.311 90 3/13/2024
1.0.310 84 3/13/2024
1.0.309 126 3/12/2024
1.0.308 117 3/12/2024
1.0.306 253 3/5/2024
1.0.305 85 3/5/2024
1.0.304 104 3/4/2024
1.0.303 87 3/4/2024
1.0.302 84 3/4/2024
1.0.301 80 3/4/2024
1.0.300 111 3/3/2024
1.0.299 76 3/3/2024
1.0.298 238 2/26/2024
1.0.297 65 2/26/2024
1.0.296 88 2/25/2024
1.0.295 80 2/25/2024
1.0.294 97 2/24/2024
1.0.293 81 2/24/2024
1.0.292 83 2/24/2024
1.0.291 86 2/24/2024
1.0.290 76 2/24/2024
1.0.289 83 2/24/2024
1.0.288 175 2/21/2024
1.0.287 92 2/21/2024
1.0.286 1,791 12/12/2023
1.0.285 95 12/12/2023
1.0.259 1,506 10/17/2023
1.0.258 97 10/17/2023
1.0.257 209 10/13/2023
1.0.256 101 10/13/2023
1.0.255 200 10/10/2023
1.0.254 109 10/10/2023
1.0.253 155 9/19/2023
1.0.252 102 9/19/2023
1.0.251 119 9/13/2023
1.0.250 115 9/13/2023
1.0.245 148 7/26/2023
1.0.244 136 7/26/2023
1.0.243 148 7/19/2023
1.0.242 139 7/19/2023
1.0.241 115 7/11/2023
1.0.240 127 7/11/2023
1.0.239 127 7/7/2023
1.0.238 114 7/7/2023
1.0.237 140 7/6/2023
1.0.236 131 7/6/2023
1.0.235 125 7/6/2023
1.0.234 133 7/6/2023
1.0.232 122 7/5/2023
1.0.231 129 7/5/2023
1.0.230 130 7/5/2023
1.0.229 141 7/5/2023
1.0.228 133 7/5/2023
1.0.227 132 7/5/2023
1.0.226 129 7/4/2023
1.0.225 124 7/4/2023
1.0.224 156 7/3/2023
1.0.223 130 7/3/2023
1.0.222 125 6/30/2023
1.0.221 113 6/30/2023
1.0.220 137 6/30/2023
1.0.219 125 6/30/2023
1.0.218 153 6/17/2023
1.0.217 135 6/17/2023
1.0.214 137 6/6/2023
1.0.213 129 6/6/2023
1.0.212 121 6/6/2023
1.0.211 127 6/6/2023
1.0.206 122 6/5/2023
1.0.205 120 6/5/2023
1.0.204 144 6/2/2023
1.0.203 105 6/2/2023
1.0.202 139 6/2/2023
1.0.201 137 6/2/2023
1.0.190 542 5/27/2022
1.0.189 497 5/27/2022
1.0.188 508 5/23/2022
1.0.187 515 5/23/2022
1.0.186 473 5/18/2022
1.0.185 482 5/18/2022
1.0.184 524 5/18/2022
1.0.183 517 5/18/2022
1.0.182 516 5/17/2022
1.0.181 512 5/17/2022
1.0.180 509 5/11/2022
1.0.179 519 5/11/2022
1.0.178 529 5/6/2022
1.0.177 533 5/6/2022
1.0.176 553 4/2/2022
1.0.175 536 4/2/2022
1.0.174 521 3/24/2022
1.0.173 509 3/24/2022
1.0.172 479 3/23/2022
1.0.171 500 3/23/2022
1.0.170 500 3/23/2022
1.0.169 495 3/23/2022
1.0.168 532 3/21/2022
1.0.167 524 3/21/2022
1.0.166 522 3/19/2022
1.0.165 545 3/19/2022
1.0.164 521 3/17/2022
1.0.163 523 3/17/2022
1.0.162 514 3/17/2022
1.0.161 526 3/17/2022
1.0.160 512 3/16/2022
1.0.159 531 3/16/2022
1.0.158 536 3/7/2022
1.0.157 534 3/7/2022
1.0.156 524 3/6/2022
1.0.155 522 3/6/2022
1.0.154 532 3/6/2022
1.0.153 530 3/6/2022
1.0.152 524 3/6/2022
1.0.151 536 3/6/2022
1.0.150 521 3/6/2022
1.0.149 544 3/6/2022
1.0.148 545 3/5/2022
1.0.147 536 3/5/2022
1.0.146 500 3/5/2022
1.0.145 628 3/5/2022
1.0.144 624 3/5/2022
1.0.143 638 3/5/2022
1.0.142 633 3/5/2022
1.0.140 534 3/5/2022
1.0.139 513 3/5/2022
1.0.137 517 3/5/2022
1.0.136 497 3/5/2022
1.0.135 389 3/5/2022
1.0.134 395 3/5/2022
1.0.133 528 3/5/2022
1.0.132 533 3/5/2022
1.0.131 512 3/5/2022
1.0.130 534 3/5/2022
1.0.128 512 3/5/2022
1.0.126 397 3/5/2022
1.0.125 415 3/4/2022
1.0.124 415 3/4/2022
1.0.123 409 3/4/2022
1.0.122 422 3/4/2022
1.0.120 429 3/4/2022
1.0.119 413 3/4/2022
1.0.118 406 3/3/2022
1.0.117 394 3/3/2022
1.0.116 392 3/3/2022
1.0.115 420 3/3/2022
1.0.114 426 2/21/2022
1.0.113 407 2/21/2022
1.0.112 437 2/19/2022
1.0.111 404 2/18/2022
1.0.110 408 2/18/2022
1.0.109 405 2/18/2022
1.0.107 401 2/17/2022
1.0.106 773 2/17/2022
1.0.105 447 1/18/2022
1.0.104 434 1/18/2022
1.0.103 282 12/20/2021
1.0.102 278 12/20/2021
1.0.101 265 12/20/2021
1.0.100 264 12/20/2021
1.0.99 245 12/20/2021
1.0.98 239 12/20/2021
1.0.96 268 12/18/2021
1.0.94 304 12/18/2021
1.0.93 283 12/18/2021
1.0.92 297 12/18/2021
1.0.0 405 3/5/2022