support ubl creditnotes
This commit is contained in:
@@ -100,6 +100,7 @@ public class ZUGFeRDVisualizer {
|
||||
String zf1Signature = "rsm:CrossIndustryDocument";
|
||||
String zf2Signature = "rsm:CrossIndustryInvoice";
|
||||
String ublSignature = "ubl:Invoice";
|
||||
String ublCreditNoteSignature = "ubl:CreditNote";
|
||||
boolean doPostProcessing=false;
|
||||
if (fileContent.contains(zf1Signature)) {
|
||||
applyZF1XSLT(fis, baos);
|
||||
@@ -114,6 +115,11 @@ public class ZUGFeRDVisualizer {
|
||||
applyUBL2XSLT(fis, iaos);
|
||||
doPostProcessing=true;
|
||||
|
||||
} else if (fileContent.contains(ublCreditNoteSignature)) {
|
||||
//zf2 or fx
|
||||
applyUBLCreditNote2XSLT(fis, iaos);
|
||||
doPostProcessing=true;
|
||||
|
||||
}
|
||||
if (doPostProcessing) {
|
||||
// take the copy of the stream and re-write it to an InputStream
|
||||
@@ -174,6 +180,17 @@ public class ZUGFeRDVisualizer {
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
}
|
||||
|
||||
public void applyUBLCreditNote2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
throws TransformerException {
|
||||
if (mXsltUBLTemplate==null) {
|
||||
mXsltUBLTemplate = mFactory.newTemplates(
|
||||
new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/ubl-creditnote-xr.xsl")));
|
||||
}
|
||||
Transformer transformer = mXsltUBLTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
}
|
||||
|
||||
public void applyZF1XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
throws TransformerException {
|
||||
Transformer transformer = mXsltZF1HTMLTemplate.newTransformer();
|
||||
|
||||
Reference in New Issue
Block a user