MERSEL.Services.XsltService.Client 1.3.1

dotnet add package MERSEL.Services.XsltService.Client --version 1.3.1
                    
NuGet\Install-Package MERSEL.Services.XsltService.Client -Version 1.3.1
                    
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="MERSEL.Services.XsltService.Client" Version="1.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MERSEL.Services.XsltService.Client" Version="1.3.1" />
                    
Directory.Packages.props
<PackageReference Include="MERSEL.Services.XsltService.Client" />
                    
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 MERSEL.Services.XsltService.Client --version 1.3.1
                    
#r "nuget: MERSEL.Services.XsltService.Client, 1.3.1"
                    
#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.
#:package MERSEL.Services.XsltService.Client@1.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MERSEL.Services.XsltService.Client&version=1.3.1
                    
Install as a Cake Addin
#tool nuget:?package=MERSEL.Services.XsltService.Client&version=1.3.1
                    
Install as a Cake Tool

MERSEL.Services.XsltService.Client

MERSEL.Services.XsltService mikroservisinin validate ve transform endpointlerini HTTP ile çağıran .NET istemci paketidir.

Install

dotnet add package MERSEL.Services.XsltService.Client

DI Registration

// appsettings.json -> Services:XsltService:BaseUrl
builder.Services.AddXsltServiceClient(builder.Configuration);

// or direct URL
builder.Services.AddXsltServiceClient("http://localhost:8080");

appsettings.json

{
  "Services": {
    "XsltService": {
      "BaseUrl": "http://localhost:8080"
    }
  }
}

Usage

using MERSEL.Services.XsltService.Client.Interfaces;
using MERSEL.Services.XsltService.Client.Models;

public sealed class InvoiceService(IXsltServiceClient xsltClient)
{
    public async Task<ValidationResponse?> ValidateAsync(byte[] xml, CancellationToken ct)
    {
        var response = await xsltClient.ValidateAsync(new ValidationRequest
        {
            Source = xml,
            Profile = "unsigned",
            Suppressions = new[] { "InvoiceIDCheck" },
            Parameters = new[] { new SchematronParameter("type", "TEMELFATURA") }
        }, ct);

        return response.Result;
    }

    public async Task<string> TransformAsync(byte[] xml, CancellationToken ct)
    {
        var transformed = await xsltClient.TransformAsync(new TransformRequest
        {
            Document = xml,
            TransformType = TransformType.INVOICE,
            UseEmbeddedXslt = true
        }, ct);

        return transformed.HtmlContent;
    }
}

Security Violation Detection

Transform yanıtlarında sunucu tarafında otomatik HTML sanitization uygulanır. Exfiltration riski taşıyan scriptler kaldırılır ve detayları response header'larından okunur.

var result = await xsltClient.TransformAsync(new TransformRequest
{
    Document = xml,
    TransformType = TransformType.INVOICE
}, ct);

// Güvenlik ihlali var mı?
if (result.HasSecurityViolations)
{
    logger.LogWarning(
        "{Count} script kaldırıldı. İhlaller: {Violations}",
        result.ScriptsRemoved,
        string.Join("; ", result.SecurityViolations));
}
Property Tip Açıklama
ScriptsRemoved int Kaldırılan script sayısı
SecurityViolations IReadOnlyList<string> İhlal detay listesi
HasSecurityViolations bool SecurityViolations.Count > 0

Olası violation mesajları: cookie access, domain manipulation, localStorage access, sessionStorage access, redirect/exfiltration via location, window.open exfiltration, XHR network call, fetch API network call, sendBeacon exfiltration, WebSocket connection, cross-origin messaging, dynamic code execution (eval), dynamic code execution (Function constructor), dynamic module import, UI blocking dialog (alert), UI blocking dialog (confirm), UI blocking dialog (prompt).

Targets

  • net6.0
  • net7.0
  • net8.0
  • net9.0
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 is compatible.  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 is compatible.  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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.1 122 6/7/2026
1.2.2 144 3/12/2026
1.2.0 123 2/21/2026
1.1.0 115 2/17/2026
1.0.1 126 2/16/2026
1.0.0 121 2/16/2026