Do not trim trailing whitespace in XML submitted by the user, e.g. for XRechnung Skonto in PaymenttermsDescription

This commit is contained in:
jstaerk
2021-11-16 21:07:04 +01:00
parent 099ce840d1
commit 63f33cabc7
3 changed files with 6 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
- Fixed an error validation UBL files - Fixed an error validation UBL files
- unknown root elements will now throw type 3 errors - unknown root elements will now throw type 3 errors
- added some tests - added some tests
- Do not trim trailing whitespace in XML submitted by the user, e.g. for XRechnung Skonto in PaymenttermsDescription
2.3.1 2.3.1
======= =======

View File

@@ -93,6 +93,7 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
} }
try { try {
final OutputFormat format = OutputFormat.createPrettyPrint(); final OutputFormat format = OutputFormat.createPrettyPrint();
format.setTrimText(false);
final XMLWriter writer = new XMLWriter(sw, format); final XMLWriter writer = new XMLWriter(sw, format);
writer.write(document); writer.write(document);
res = sw.toString().getBytes("UTF-8"); res = sw.toString().getBytes("UTF-8");

View File

@@ -89,6 +89,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
} }
try { try {
final OutputFormat format = OutputFormat.createPrettyPrint(); final OutputFormat format = OutputFormat.createPrettyPrint();
format.setTrimText(false);
final XMLWriter writer = new XMLWriter(sw, format); final XMLWriter writer = new XMLWriter(sw, format);
writer.write(document); writer.write(document);
res = sw.toString().getBytes("UTF-8"); res = sw.toString().getBytes("UTF-8");