FileToBase64

This function encodes a file into Base64 format.

Uses

The syntax to be used : AddFileConnector({connectorAlias} , {sensType}, {fileType})

where :

  • connectorAlias: the alias used in the scenario to define a connector. (SplitXML1 , AlertJob2 ...)
  • sensType: input or output files ( IN or OUT ), it's optional and takes as default value ANY.
  • fileType: EDI, Format, StyleSheet ...

Examples

fileTObase64.png

In this example, we send an XML file and try to encode a file.

the XSL used : 

  • connectorAlias: the alias used in the scenario to define a connector. (SplitXML1 , AlertJob2 ...)
  • sensType: input or output files ( IN or OUT ), it's optional and takes as default value ANY.
  • fileType: EDI, Format, StyleSheet ...

Upon execution, a file is generated, containing the encoded value of the file in base 64 format, enclosed within the 'TEST' tag

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ixf="http://www.ixPath.com/Function" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ix="localFunction" xmlns:fn="http://www.w3.org/2005/xpath-functions" >
 <xsl:output method="xml" indent="yes"/>
  <!-- Beginning of the Translation -->
  <xsl:template match="/">
   <ixDOC>
   <TEST><xsl:value-of select="ixf:FileToBase64('FtpListener1')"/></TEST>
   </ixDOC>
  </xsl:template>
</xsl:stylesheet>
Tags:
Created by Outhman Moustaghfir on 2023/07/24 12:53
    
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian