Insert Encoded External File

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  User Guide and Reference > Menu Commands > XML Menu > Insert >

Insert Encoded External File

The XML | Insert | Encoded External File command is available in Grid View only. It inserts a binary encoded file, such as an image file,  as encoded characters. The encoded external file is inserted before the Grid View selection.

 

On clicking the command, the Insert Encoded External File dialog (screenshot below) pops up. In it you enter the path to the file, select the encoding you want, and specify whether the encoded file is to be inserted in an element or not.

InsertEncodedXMLFileDlg

You can browse for or enter the name of the external file to be encoded and embedded. Either a Base-16 or Base-64 encoding must be specified. If you wish to enclose the encoded text in an element, then check the Create Element check box and specify the name of the desired element in the Create Element text box. If the Create Element check box is not checked, then the encoded text will be inserted directly at the cursor location.

 

On clicking OK, the encoded text of the selected file is inserted at the cursor location, with an enclosing element if this has been specified.

 

The encoded file is inserted in Grid View (the highlighted element in the screenshot below).

InsertEncodedXMLFile

In Text View, the file will be inserted as below.

 

<img ext="jpg" encoding="xs:base64Binary">

  iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/

  //+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U

  g9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC

</img>

 

The listing above shows the encoded text of a JPG image file. An img element was created around the encoded text.

 


© 2019 Altova GmbH