Replies: 3 comments 5 replies
-
Ich habe mir das schonmal angesehen. Die onboard XSLT-Funktionen von .net core reichen leider nicht, da Funktionen wie document-uri() genutzt werden, die dort nicht verfügbar sind (die Funktion gibt es in xslt 2.0). Eine gute weitere Alternative ist Saxon mit Saxon HE (HE = Home Edition), aber dies funktioniert nicht mit .net core. Es gibt Wrapper, um neue Versionen von saxon über ikvm zu wrappen, aber das erscheint mir nicht besonders robust. Ich habe es dann noch mit mvp.xml probiert: string xmlInputPath = @"factur-x.xml";
string xslPath = @"...\XRechnung-CII-validation.xsl";
string xmlOutputPath = "output.html";
try
{
MvpXslTransform xslt = new MvpXslTransform();
xslt.Load(xslPath);
using (XmlReader xmlReader = XmlReader.Create(xmlInputPath))
using (XmlWriter xmlWriter = XmlWriter.Create(xmlOutputPath, new XmlWriterSettings { Indent = true }))
{
xslt.Transform(new XmlInput(xmlReader), new XsltArgumentList(), new XmlOutput(xmlWriter));
}
Console.WriteLine("Transformation abgeschlossen.");
Console.WriteLine($"Ausgabe wurde in: {xmlOutputPath} gespeichert.");
}
catch (Exception ex)
{
Console.WriteLine($"Ein Fehler ist aufgetreten: {ex.Message}");
} aber auch hier wird gemeldet, dass document-uri() nicht bekannt ist. Also ebenfalls keine Unterstützung für xslt 2.0. |
Beta Was this translation helpful? Give feedback.
-
Ich habe etwas rumgespielt mit: das funktioniert dann ganz gut: ist aber ein Kommandozeilen-Tool, das installiert werden muss. |
Beta Was this translation helpful? Give feedback.
-
Ja, habe es aber abgespeckt und ist auch nicht schoen, aber immerhin |
Beta Was this translation helpful? Give feedback.
-
Ich möchte hier nur Ideen und Ansätze sammeln.
Wie wäre der Ansatz in .NET? Wie fängt man an? Hat jemand Erfahrung damit und könnte ein paar Tipps geben?
Ich arbeite an der Portierung dieser Lib nach Delphi und nutze derzeit eine Java-Umgebung zur Validierung und Visualisierung von ZUGFeRD-Dateien.
https://github.com/LandrixSoftware/ZUGFeRD-for-Delphi
Wenn man z.B. die Validierung in .NET umsetzt, könnte ich das sicher auch einfach portieren.
Beta Was this translation helpful? Give feedback.
All reactions