Mersel.EBelge.XsltService
0.5.10
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.8
This package targets .NET Framework 4.8. The package is compatible with this framework or higher.
dotnet add package Mersel.EBelge.XsltService --version 0.5.10
NuGet\Install-Package Mersel.EBelge.XsltService -Version 0.5.10
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.EBelge.XsltService" Version="0.5.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mersel.EBelge.XsltService" Version="0.5.10" />
<PackageReference Include="Mersel.EBelge.XsltService" />
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.EBelge.XsltService --version 0.5.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Mersel.EBelge.XsltService, 0.5.10"
#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.EBelge.XsltService@0.5.10
#: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.EBelge.XsltService&version=0.5.10
#tool nuget:?package=Mersel.EBelge.XsltService&version=0.5.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Mersel.EBelge.XsltService
Türkiye e-Belge (e-Fatura / e-Arşiv / e-İrsaliye / e-Defter) için:
- XSD doğrulama (JAXP, xs:include / HTTP-import çözümlemesiyle)
- Schematron doğrulama (Saxon HE 11.6, ISO 3-step pipeline)
- XSLT 3.0 dönüşüm + HTML sanitization (No-Exfiltration Sandbox) + filigran
- Belge tipi otomatik tespiti (UBL-TR / e-Arşiv / e-Defter Yevmiye/Kebir/Berat / Envanter)
- GİB paket sync (resmi ZIP'leri indir + aç)
- Validation profile + suppression (programmatic API)
C# native API, IKVM köprüsü, JRE gerekmez. Mersel.DssSigner'dan tamamen bağımsız.
Hedef çerçeveler
- .NET Framework 4.8 (
net48) - .NET 8 (
net8.0)
Hızlı başlangıç
using Mersel.EBelge.XsltService;
var svc = new XsltService();
var type = svc.DetectType(File.ReadAllBytes("yevmiye-2026-05.xbrl"));
// → DocumentType.EDefterYevmiye
GİB paket sync + DiskAssetSource akışı (e-Defter için)
// 1. Resmi GİB paketlerini diske aç
var sync = new GibPackageSync();
var results = sync.SyncAll(@"C:\opt\gib-validator");
foreach (var r in results)
Console.WriteLine($"{r.PackageId}: {(r.Success ? "OK" : "FAIL " + r.Error)} ({r.FilesExtracted} dosya)");
// 2. AssetSource'u o dizine yönelt
var svc = new XsltService().UseDiskAssets(@"C:\opt\gib-validator");
// 3. Yevmiye'yi XSD + Schematron ile birlikte doğrula
var resp = svc.ValidateAllByPath(
xsdPath: "validator/eledger/schema/edefter.xsd",
schPath: "validator/eledger/schematron/edefter_yevmiye.sch",
xml: File.ReadAllBytes("yevmiye-2026-05.xbrl"));
if (!resp.IsFullyValid)
{
foreach (var e in resp.SchemaErrors) Console.WriteLine("XSD: " + e);
foreach (var e in resp.SchematronErrors) Console.WriteLine($"SCH [{e.RuleId}]: {e.Message}");
}
In-memory asset source (embedded resource)
var assets = new InMemoryAssetSource()
.Put("e-defter/yevmiye.sch", embeddedYevmiyeSch)
.Put("e-defter/yevmiye.xsd", embeddedYevmiyeXsd);
var svc = new XsltService().UseAssetSource(assets);
var resp = svc.ValidateAllByPath("e-defter/yevmiye.xsd", "e-defter/yevmiye.sch", xml);
Profile + suppression (imzasız e-Fatura uyarılarını bastırma)
var registry = new ProfileRegistry();
registry.Register(new ProfileBuilder("unsigned")
.Description("Imza zorunlulugu uyarilarini bastir")
.AddSuppression("ruleId", "UBLTR-CO-01") // tam eşleşme
.AddSuppression("text", ".*cac:Signature.*") // regex
.AddSuppression("text", ".*UUID.*", "INVOICE", "CREDIT_NOTE") // sadece bu tiplerde
.Build());
var svc = new XsltService()
.UseDiskAssets(@"C:\opt\gib-validator")
.UseProfileRegistry(registry);
var resp = svc.ValidateSchematronWithProfile(
schematronSource: File.ReadAllBytes(@"C:\opt\gib-validator\validator\ubl-tr-package\schematron\UBL-TR_Main_Schematron.xml"),
xml: File.ReadAllBytes("fatura.xml"),
profileName: "unsigned");
Console.WriteLine($"Active: {resp.SchematronErrors.Count}, suppressed: {resp.SuppressionInfo?["suppressedCount"]}");
XSLT dönüşüm — sanitize + filigran
var tr = svc.Transform(
xml: File.ReadAllBytes("fatura.xml"),
xslt: File.ReadAllBytes("ubl-to-html.xslt"),
type: TransformType.Invoice,
useEmbeddedXslt: false,
watermark: "MUSTERI KOPYASI");
File.WriteAllBytes("fatura.html", tr.HtmlContent);
Console.WriteLine($"{tr.RemovedScriptCount} script engellendi, " +
$"{tr.AllowedScriptHashes.Count} script CSP listesinde");
UseEmbeddedXslt=true ile UBL belgesindeki cac:AdditionalDocumentReference/EmbeddedDocumentBinaryObject içindeki XSLT otomatik çıkarılır.
Faz dışı / sonraki sürümler için
- Custom Schematron rule injection (caller-tanımlı
<sch:assert>öğelerini SCH XML'e gömme) - AssetVersioning hot-reload watcher
- SuppressionImpactAnalyzer (asset diff regresyon analizi)
- YAML profile loader (şu an programmatic API)
Lisans
MIT (Saxon HE: MPL 2.0).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. |
| .NET Framework | net48 is compatible. net481 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.
Faz 1: SAX-based DocumentType detection (UBL-TR), JAXP XSD validation, Saxon HE 11.6 XSLT 3.0 transform. Mersel.DssSigner'dan tamamen bagimsiz.