<
From version < 2.1 >
edited by Outhman Moustaghfir
on 2023/07/24 13:01
To version < 7.1 >
edited by Outhman Moustaghfir
on 2023/07/24 14:52
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,7 +1,50 @@
1 -{{box cssClass="floatinginfobox" title="**Contents**"}}
2 -{{toc/}}
3 -{{/box}}
1 += =
4 4  
5 5  = FileToBase64 =
6 6  
7 -
5 +
6 +This function encodes a file into Base64 format.
7 +
8 += Uses =
9 +
10 +The syntax to be used : //**AddFileConnector({connectorAlias} , {sensType}, {fileType})**//
11 +
12 +where :
13 +
14 +* connectorAlias: the alias used in the scenario to define a connector. (SplitXML1 , AlertJob2 ...)
15 +* sensType: input or output files ( //IN //or //OUT //), it's optional and takes as default value //ANY.//
16 +* fileType: EDI, Format, StyleSheet ...
17 +
18 +==== Examples ====
19 +
20 +[[image:fileTObase64.png]]
21 +
22 +In this example, we send an XML file and try to encode a file.
23 +
24 +the XSL used :
25 +
26 +{{code language="xml"}}
27 +<?xml version="1.0" encoding="utf-8"?>
28 +    <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" >
29 +        <xsl:output method="xml" indent="yes"/>
30 +            <!-- Beginning of the Translation -->
31 +            <xsl:template match="/">
32 +                <ixDOC>
33 +                <TEST><xsl:value-of select="ixf:FileToBase64('FtpListener1')"/></TEST> 
34 +                </ixDOC>
35 +            </xsl:template>
36 +</xsl:stylesheet>
37 +{{/code}}
38 +
39 +Upon execution, a file is generated, containing the encoded value of the file in base 64 format, enclosed within the 'TEST' tag
40 +
41 +{{code language="xml"}}
42 +<?xml version="1.0" encoding="UTF-8"?>
43 +<ixDOC xmlns:ixf="http://www.ixPath.com/Function"
44 +       xmlns:xs="http://www.w3.org/2001/XMLSchema"
45 +       xmlns:ix="localFunction"
46 +       xmlns:fn="http://www.w3.org/2005/xpath-functions">
47 +   <TEST>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCg0KICAgPGl4RG9jPg0KICAgIA0KCQ0KCTxNZXNzYWdlIHNlbGVjdD0gIkEubnVtYmVyLEMuTkFNRSBBUyBuYW1lc3RlLEIuTkFNRSBBUyBuYW1lY2xpZW50LCBBLnNvdXJjZSwgQS5jcmVhdGVkICwgRC5zdWJqZWN0ICIgICANCgkgICAgICAgICBmcm9tID0ib3N0X3RpY2tldCBBIEpPSU4gb3N0X3VzZXIgQiBKT0lOIG9zdF9vcmdhbml6YXRpb24gQyBKT0lOIG9zdF90aWNrZXRfX2NkYXRhIEQiIA0KCSAgICAgICAgIHdoZXJlPSIoKEIuaWQ9QS51c2VyX2lkKSBhbmQgKEIub3JnX2lkPUMuaWQpKWFuZCAoRC50aWNrZXRfaWQgPSBBLnRpY2tldF9pZCkgIg0KCSAgICAgICAgID4NCgkNCgk8L01lc3NhZ2U+DQoJDQogIDwvaXhEb2M+</TEST>
48 +</ixDOC>
49 +{{/code}}
50 +
FileToBase64 (1).xsl
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.omoustaghfir
Size
... ... @@ -1,0 +1,1 @@
1 +595 bytes
Content
... ... @@ -1,0 +1,10 @@
1 +<?xml version="1.0" encoding="windows-1251"?>
2 + <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" >
3 + <xsl:output method="xml" indent="yes"/>
4 + <!-- Beginning of the Translation -->
5 + <xsl:template match="/">
6 + <ixDOC>
7 + <TEST><xsl:value-of select="ixf:FileToBase64('C:\\Users\\Hamza BAYOUD\\Downloads\\copyFilesParams1.png')"/></TEST>
8 + </ixDOC>
9 + </xsl:template>
10 + </xsl:stylesheet>
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian