Merge pull request #547 from taskinkemal/master

Improve toFOP method: Parameterize the input stream and the EStandard input
This commit is contained in:
Jochen Staerk
2024-11-17 19:45:58 +01:00
committed by GitHub

View File

@@ -249,6 +249,12 @@ public class ZUGFeRDVisualizer {
EStandard theStandard = findOutStandardFromRootNode(fis);
fis = new FileInputStream(xmlFilename);//rewind :-(
return toFOP(fis, theStandard);
}
protected String toFOP(InputStream is, EStandard theStandard)
throws FileNotFoundException, TransformerException {
try {
if (mXsltPDFTemplate == null) {
mXsltPDFTemplate = mFactory.newTemplates(
@@ -263,11 +269,11 @@ public class ZUGFeRDVisualizer {
//zf2 or fx
if (theStandard == EStandard.facturx) {
applyZF2XSLT(fis, iaos);
applyZF2XSLT(is, iaos);
} else if (theStandard == EStandard.ubl) {
applyUBL2XSLT(fis, iaos);
applyUBL2XSLT(is, iaos);
} else if (theStandard == EStandard.ubl_creditnote) {
applyUBLCreditNote2XSLT(fis, iaos);
applyUBLCreditNote2XSLT(is, iaos);
}