Skip to content

Commit

Permalink
Improve toFOP method: Parameterize the input stream and the EStandard…
Browse files Browse the repository at this point in the history
… input
  • Loading branch information
taskinkemal committed Nov 6, 2024
1 parent d8ba834 commit 66bb3c4
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ protected String toFOP(String xmlFilename)
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(
Expand All @@ -263,11 +269,11 @@ protected String toFOP(String xmlFilename)

//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);
}


Expand Down

0 comments on commit 66bb3c4

Please sign in to comment.