Please enable JavaScript to view this site.

Altova XMLSpy 2022 Enterprise Edition

Images can be displayed directly in Grid View (see screenshot below). In order to do this, the image must be inserted in its a Base64-encoding.

XSXMLGridViewImages

There are two ways to insert a Base64-encoded image in a Grid View cell:

 

Create a node that is of type Formula. In the formula expression cell (see screenshot above), enter the following XPath expression to convert an image to its Base64 encoding: unparsed-text("<Image-URL>", "x-binarytobase64"). The XPath function unparsed-text converts the image to Base64 encoding. The image will be rendered below the cell containing the formula expression.

Place the cursor in the cell into which you want to add the image. For example, in the screenshot above, the image is added as content of the second Image element by selecting the Image element. Then select Edit | Insert | Encoded External File. In the dialog that appears: (i) enter the path to the image you want (local or internet), (ii) select Base 64, (iii) select Create Text. The image will be converted to its Base64 encoding, and the encoded text will be entered in the cell. You will, however, see, not the encoding, but a rendering of the image in the cell (see screenshot above).

 

Image URLs can be given in the following forms, including as relative paths:

 

http://httpbin.org/image/png

file:///c:/LocalPig.png

C:/LocalPig.png

LocalPig.png

 

Most of the image formats that are commonly used are supported. These include PNG, JPEG, BMP, and animated GIFs. SVG is read as an XML document; in Grid View, the image is displayed as the last child of the <svg> element.

 

© 2015-2021 Altova GmbH