Black.Beard.Jslt 1.0.300

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.300
                    
NuGet\Install-Package Black.Beard.Jslt -Version 1.0.300
                    
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.300" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Black.Beard.Jslt" Version="1.0.300" />
                    
Directory.Packages.props
<PackageReference Include="Black.Beard.Jslt" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Black.Beard.Jslt --version 1.0.300
                    
#r "nuget: Black.Beard.Jslt, 1.0.300"
                    
#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.
#addin nuget:?package=Black.Beard.Jslt&version=1.0.300
                    
Install as a Cake Addin
#tool nuget:?package=Black.Beard.Jslt&version=1.0.300
                    
Install as a Cake Tool

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.374 135 12/7/2024
1.0.373 125 12/7/2024
1.0.372 124 11/20/2024
1.0.371 118 11/20/2024
1.0.370 112 11/16/2024
1.0.369 106 11/16/2024
1.0.368 125 11/14/2024
1.0.367 111 11/14/2024
1.0.366 120 11/13/2024
1.0.365 107 11/13/2024
1.0.364 121 11/12/2024
1.0.363 122 11/12/2024
1.0.362 124 11/11/2024
1.0.361 119 11/11/2024
1.0.360 118 11/11/2024
1.0.359 117 11/11/2024
1.0.358 129 11/11/2024
1.0.357 124 11/11/2024
1.0.356 119 11/10/2024
1.0.355 114 11/10/2024
1.0.354 123 10/28/2024
1.0.353 111 10/28/2024
1.0.352 108 10/28/2024
1.0.351 114 10/28/2024
1.0.350 141 5/2/2024
1.0.349 124 5/2/2024
1.0.348 131 5/2/2024
1.0.347 111 5/2/2024
1.0.346 160 4/7/2024
1.0.345 153 4/7/2024
1.0.344 140 4/5/2024
1.0.343 141 4/5/2024
1.0.342 157 4/5/2024
1.0.341 140 4/5/2024
1.0.340 141 4/4/2024
1.0.339 158 4/4/2024
1.0.338 153 4/3/2024
1.0.337 167 4/3/2024
1.0.336 156 4/3/2024
1.0.335 125 4/3/2024
1.0.334 139 4/2/2024
1.0.333 138 4/2/2024
1.0.332 146 4/2/2024
1.0.331 154 4/2/2024
1.0.330 146 4/2/2024
1.0.329 135 4/2/2024
1.0.328 160 4/1/2024
1.0.327 142 4/1/2024
1.0.325 141 4/1/2024
1.0.324 152 4/1/2024
1.0.323 148 4/1/2024
1.0.322 145 3/31/2024
1.0.321 145 3/31/2024
1.0.319 149 3/31/2024
1.0.318 139 3/31/2024
1.0.317 301 3/19/2024
1.0.316 141 3/19/2024
1.0.315 237 3/15/2024
1.0.314 162 3/15/2024
1.0.313 176 3/13/2024
1.0.312 161 3/13/2024
1.0.311 156 3/13/2024
1.0.310 151 3/13/2024
1.0.309 194 3/12/2024
1.0.308 209 3/12/2024
1.0.306 324 3/5/2024
1.0.305 152 3/5/2024
1.0.304 173 3/4/2024
1.0.303 151 3/4/2024
1.0.302 154 3/4/2024
1.0.301 152 3/4/2024
1.0.300 181 3/3/2024
1.0.299 147 3/3/2024
1.0.298 314 2/26/2024
1.0.297 154 2/26/2024
1.0.296 155 2/25/2024
1.0.295 150 2/25/2024
1.0.294 155 2/24/2024
1.0.293 145 2/24/2024
1.0.292 141 2/24/2024
1.0.291 153 2/24/2024
1.0.290 145 2/24/2024
1.0.289 145 2/24/2024
1.0.288 241 2/21/2024
1.0.287 162 2/21/2024
1.0.286 1,852 12/12/2023
1.0.285 157 12/12/2023
1.0.259 1,561 10/17/2023
1.0.258 145 10/17/2023
1.0.257 255 10/13/2023
1.0.256 154 10/13/2023
1.0.255 249 10/10/2023
1.0.254 162 10/10/2023
1.0.253 210 9/19/2023
1.0.252 152 9/19/2023
1.0.251 180 9/13/2023
1.0.250 167 9/13/2023
1.0.245 203 7/26/2023
1.0.244 189 7/26/2023
1.0.243 210 7/19/2023
1.0.242 199 7/19/2023
1.0.241 175 7/11/2023
1.0.240 187 7/11/2023
1.0.239 186 7/7/2023
1.0.238 172 7/7/2023
1.0.237 203 7/6/2023
1.0.236 184 7/6/2023
1.0.235 179 7/6/2023
1.0.234 187 7/6/2023
1.0.232 178 7/5/2023
1.0.231 186 7/5/2023
1.0.230 205 7/5/2023
1.0.229 193 7/5/2023
1.0.228 185 7/5/2023
1.0.227 188 7/5/2023
1.0.226 189 7/4/2023
1.0.225 181 7/4/2023
1.0.224 212 7/3/2023
1.0.223 185 7/3/2023
1.0.222 189 6/30/2023
1.0.221 166 6/30/2023
1.0.220 194 6/30/2023
1.0.219 181 6/30/2023
1.0.218 216 6/17/2023
1.0.217 194 6/17/2023
1.0.214 206 6/6/2023
1.0.213 188 6/6/2023
1.0.212 189 6/6/2023
1.0.211 185 6/6/2023
1.0.206 185 6/5/2023
1.0.205 190 6/5/2023
1.0.204 205 6/2/2023
1.0.203 170 6/2/2023
1.0.202 199 6/2/2023
1.0.201 199 6/2/2023
1.0.190 624 5/27/2022
1.0.189 573 5/27/2022
1.0.188 587 5/23/2022
1.0.187 594 5/23/2022
1.0.186 555 5/18/2022
1.0.185 558 5/18/2022
1.0.184 595 5/18/2022
1.0.183 599 5/18/2022
1.0.182 600 5/17/2022
1.0.181 588 5/17/2022
1.0.180 582 5/11/2022
1.0.179 597 5/11/2022
1.0.178 604 5/6/2022
1.0.177 609 5/6/2022
1.0.176 637 4/2/2022
1.0.175 615 4/2/2022
1.0.174 605 3/24/2022
1.0.173 592 3/24/2022
1.0.172 554 3/23/2022
1.0.171 586 3/23/2022
1.0.170 582 3/23/2022
1.0.169 575 3/23/2022
1.0.168 615 3/21/2022
1.0.167 605 3/21/2022
1.0.166 607 3/19/2022
1.0.165 627 3/19/2022
1.0.164 595 3/17/2022
1.0.163 596 3/17/2022
1.0.162 594 3/17/2022
1.0.161 616 3/17/2022
1.0.160 593 3/16/2022
1.0.159 617 3/16/2022
1.0.158 619 3/7/2022
1.0.157 616 3/7/2022
1.0.156 606 3/6/2022
1.0.155 606 3/6/2022
1.0.154 619 3/6/2022
1.0.153 623 3/6/2022
1.0.152 618 3/6/2022
1.0.151 623 3/6/2022
1.0.150 619 3/6/2022
1.0.149 632 3/6/2022
1.0.148 633 3/5/2022
1.0.147 623 3/5/2022
1.0.146 577 3/5/2022
1.0.145 728 3/5/2022
1.0.144 715 3/5/2022
1.0.143 737 3/5/2022
1.0.142 714 3/5/2022
1.0.140 620 3/5/2022
1.0.139 598 3/5/2022
1.0.137 603 3/5/2022
1.0.136 583 3/5/2022
1.0.135 473 3/5/2022
1.0.134 479 3/5/2022
1.0.133 612 3/5/2022
1.0.132 615 3/5/2022
1.0.131 598 3/5/2022
1.0.130 624 3/5/2022
1.0.128 604 3/5/2022
1.0.126 476 3/5/2022
1.0.125 502 3/4/2022
1.0.124 497 3/4/2022
1.0.123 501 3/4/2022
1.0.122 510 3/4/2022
1.0.120 506 3/4/2022
1.0.119 494 3/4/2022
1.0.118 485 3/3/2022
1.0.117 480 3/3/2022
1.0.116 476 3/3/2022
1.0.115 497 3/3/2022
1.0.114 505 2/21/2022
1.0.113 482 2/21/2022
1.0.112 517 2/19/2022
1.0.111 486 2/18/2022
1.0.110 493 2/18/2022
1.0.109 488 2/18/2022
1.0.107 484 2/17/2022
1.0.106 1,413 2/17/2022
1.0.105 525 1/18/2022
1.0.104 517 1/18/2022
1.0.103 359 12/20/2021
1.0.102 361 12/20/2021
1.0.101 345 12/20/2021
1.0.100 348 12/20/2021
1.0.99 329 12/20/2021
1.0.98 312 12/20/2021
1.0.96 345 12/18/2021
1.0.94 391 12/18/2021
1.0.93 361 12/18/2021
1.0.92 380 12/18/2021
1.0.0 500 3/5/2022