Please enable JavaScript to view this site.

Altova XMLSpy 2020 Enterprise Edition

The XML | Insert | Encoded External File command is available in Grid View only. It inserts a binary encoded file, such as an image file, in a character-encoded format. The encoded external file is inserted before the component selected in Grid View. On clicking the command, the Insert Encoded External File dialog (screenshot below) appears. In it, you enter the path to the file, select the encoding you want, and specify whether the encoded file is to be inserted as an element before the currently selected element or as text (without a surrounding element).

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 select the Create Element radio button and specify the element name in the Create Element text box.

 

On clicking OK, the encoded text of the selected file is inserted before the current selection, 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.

 

© 2020 Altova GmbH