Black.Beard.Jslt 1.0.203

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

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

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 75 5/2/2024
1.0.349 67 5/2/2024
1.0.348 77 5/2/2024
1.0.347 58 5/2/2024
1.0.346 103 4/7/2024
1.0.345 91 4/7/2024
1.0.344 64 4/5/2024
1.0.343 61 4/5/2024
1.0.342 76 4/5/2024
1.0.341 78 4/5/2024
1.0.340 89 4/4/2024
1.0.339 88 4/4/2024
1.0.338 96 4/3/2024
1.0.337 102 4/3/2024
1.0.336 96 4/3/2024
1.0.335 86 4/3/2024
1.0.334 87 4/2/2024
1.0.333 74 4/2/2024
1.0.332 81 4/2/2024
1.0.331 95 4/2/2024
1.0.330 84 4/2/2024
1.0.329 77 4/2/2024
1.0.328 93 4/1/2024
1.0.327 76 4/1/2024
1.0.325 74 4/1/2024
1.0.324 87 4/1/2024
1.0.323 88 4/1/2024
1.0.322 78 3/31/2024
1.0.321 76 3/31/2024
1.0.319 86 3/31/2024
1.0.318 81 3/31/2024
1.0.317 230 3/19/2024
1.0.316 77 3/19/2024
1.0.315 175 3/15/2024
1.0.314 94 3/15/2024
1.0.313 120 3/13/2024
1.0.312 98 3/13/2024
1.0.311 93 3/13/2024
1.0.310 92 3/13/2024
1.0.309 137 3/12/2024
1.0.308 122 3/12/2024
1.0.306 260 3/5/2024
1.0.305 90 3/5/2024
1.0.304 109 3/4/2024
1.0.303 92 3/4/2024
1.0.302 95 3/4/2024
1.0.301 85 3/4/2024
1.0.300 117 3/3/2024
1.0.299 81 3/3/2024
1.0.298 244 2/26/2024
1.0.297 70 2/26/2024
1.0.296 93 2/25/2024
1.0.295 86 2/25/2024
1.0.294 103 2/24/2024
1.0.293 88 2/24/2024
1.0.292 88 2/24/2024
1.0.291 98 2/24/2024
1.0.290 84 2/24/2024
1.0.289 90 2/24/2024
1.0.288 179 2/21/2024
1.0.287 102 2/21/2024
1.0.286 1,798 12/12/2023
1.0.285 100 12/12/2023
1.0.259 1,511 10/17/2023
1.0.258 101 10/17/2023
1.0.257 213 10/13/2023
1.0.256 111 10/13/2023
1.0.255 205 10/10/2023
1.0.254 114 10/10/2023
1.0.253 161 9/19/2023
1.0.252 107 9/19/2023
1.0.251 124 9/13/2023
1.0.250 126 9/13/2023
1.0.245 154 7/26/2023
1.0.244 141 7/26/2023
1.0.243 159 7/19/2023
1.0.242 144 7/19/2023
1.0.241 120 7/11/2023
1.0.240 132 7/11/2023
1.0.239 138 7/7/2023
1.0.238 119 7/7/2023
1.0.237 151 7/6/2023
1.0.236 136 7/6/2023
1.0.235 130 7/6/2023
1.0.234 138 7/6/2023
1.0.232 127 7/5/2023
1.0.231 140 7/5/2023
1.0.230 135 7/5/2023
1.0.229 146 7/5/2023
1.0.228 138 7/5/2023
1.0.227 138 7/5/2023
1.0.226 134 7/4/2023
1.0.225 135 7/4/2023
1.0.224 161 7/3/2023
1.0.223 135 7/3/2023
1.0.222 131 6/30/2023
1.0.221 118 6/30/2023
1.0.220 142 6/30/2023
1.0.219 130 6/30/2023
1.0.218 158 6/17/2023
1.0.217 140 6/17/2023
1.0.214 142 6/6/2023
1.0.213 134 6/6/2023
1.0.212 126 6/6/2023
1.0.211 132 6/6/2023
1.0.206 127 6/5/2023
1.0.205 125 6/5/2023
1.0.204 149 6/2/2023
1.0.203 110 6/2/2023
1.0.202 144 6/2/2023
1.0.201 142 6/2/2023
1.0.190 548 5/27/2022
1.0.189 500 5/27/2022
1.0.188 511 5/23/2022
1.0.187 518 5/23/2022
1.0.186 482 5/18/2022
1.0.185 485 5/18/2022
1.0.184 527 5/18/2022
1.0.183 526 5/18/2022
1.0.182 519 5/17/2022
1.0.181 515 5/17/2022
1.0.180 512 5/11/2022
1.0.179 522 5/11/2022
1.0.178 532 5/6/2022
1.0.177 536 5/6/2022
1.0.176 557 4/2/2022
1.0.175 539 4/2/2022
1.0.174 525 3/24/2022
1.0.173 512 3/24/2022
1.0.172 482 3/23/2022
1.0.171 503 3/23/2022
1.0.170 503 3/23/2022
1.0.169 498 3/23/2022
1.0.168 541 3/21/2022
1.0.167 527 3/21/2022
1.0.166 525 3/19/2022
1.0.165 548 3/19/2022
1.0.164 524 3/17/2022
1.0.163 526 3/17/2022
1.0.162 517 3/17/2022
1.0.161 529 3/17/2022
1.0.160 515 3/16/2022
1.0.159 534 3/16/2022
1.0.158 542 3/7/2022
1.0.157 539 3/7/2022
1.0.156 530 3/6/2022
1.0.155 528 3/6/2022
1.0.154 538 3/6/2022
1.0.153 541 3/6/2022
1.0.152 536 3/6/2022
1.0.151 542 3/6/2022
1.0.150 527 3/6/2022
1.0.149 550 3/6/2022
1.0.148 551 3/5/2022
1.0.147 542 3/5/2022
1.0.146 506 3/5/2022
1.0.145 640 3/5/2022
1.0.144 630 3/5/2022
1.0.143 646 3/5/2022
1.0.142 639 3/5/2022
1.0.140 540 3/5/2022
1.0.139 519 3/5/2022
1.0.137 523 3/5/2022
1.0.136 503 3/5/2022
1.0.135 395 3/5/2022
1.0.134 401 3/5/2022
1.0.133 534 3/5/2022
1.0.132 539 3/5/2022
1.0.131 518 3/5/2022
1.0.130 540 3/5/2022
1.0.128 518 3/5/2022
1.0.126 403 3/5/2022
1.0.125 421 3/4/2022
1.0.124 421 3/4/2022
1.0.123 415 3/4/2022
1.0.122 434 3/4/2022
1.0.120 435 3/4/2022
1.0.119 419 3/4/2022
1.0.118 412 3/3/2022
1.0.117 399 3/3/2022
1.0.116 402 3/3/2022
1.0.115 425 3/3/2022
1.0.114 430 2/21/2022
1.0.113 410 2/21/2022
1.0.112 440 2/19/2022
1.0.111 407 2/18/2022
1.0.110 411 2/18/2022
1.0.109 408 2/18/2022
1.0.107 404 2/17/2022
1.0.106 831 2/17/2022
1.0.105 451 1/18/2022
1.0.104 437 1/18/2022
1.0.103 286 12/20/2021
1.0.102 281 12/20/2021
1.0.101 268 12/20/2021
1.0.100 267 12/20/2021
1.0.99 254 12/20/2021
1.0.98 242 12/20/2021
1.0.96 271 12/18/2021
1.0.94 307 12/18/2021
1.0.93 286 12/18/2021
1.0.92 301 12/18/2021
1.0.0 411 3/5/2022