Altova StyleVision 2023 Professional Edition

The Image command pops up the Insert Image dialog (see screenshots below), in which you can specify the image to insert. The Insert Image icon in the Insert Design Elements toolbar also pops up the Insert Image dialog.

 

The Insert Image dialog has four tabs, each of which provides a different way to specify the image location. These are:

 

Static: for entering the image URI directly

Dynamic: for obtaining the image URI from the XML document or generating it with an XPath expression

Static and dynamic: for combining the static and dynamic methods

Inline data: for selecting an image that is stored in an XML file as Base-16 or Base-64 encoded text

 

The tabs are described in detail below.

 

Static

The image URI is entered directly in the Address field (see screenshot below). In the screenshot below the image URI is: https://www.altova.com/pix/Marketing/logo.png.

 

dlg_insert_image

 

You can specify whether the URI is absolute (Absolute check box checked) or relative (Absolute check box unchecked). If a relative URI is entered, it will be resolved relative to the SPS file location. To enter the (absolute or relative) URI automatically, click Browse and browse for the image file.

 

Dynamic

An XPath expression returns the image URI. In the screenshot below, the XPath expression is @deptlogo. This assumes that the image URI is stored in the deptlogo attribute of the context node. The context node is the node within which the image is being created.

 

dlg_insert_image_dyn

 

Click the Edit XPath button to pop up the XPath Expression Builder. In the schema tree of the XPath Expression Builder, the context node will be highlighted.

 

If the SPS is DTD-based and uses unparsed entities, then, an unparsed entity that references the image URI can be used.  First, check the Treat as unparsed entity checkbox. Then enter an XPath expression that selects the node containing the unparsed entity. For details of how to use unparsed entities, see Unparsed Entity URIs.

 

Static and Dynamic

Use both the static and dynamic mechanisms together to generate the URI.

 

dlg_insert_image_stadyn

 

If the deptname attribute of the context node has a value of Marketing, then the image URI composed in the screenshot above will be: https://www.altova.com/pix/Marketing/logo.png. Note that you can use the XPath Expression Builder for the dynamic part.

 

Inline data

An image can be stored in an XML file as Base-16 or Base-64 encoded text. The XPath expression in the Insert Image dialog (see screenshot below) selects the node containing the encoded text. The Encoding combo box specifies the encoding used in the source XML so that StyleVision can correctly read the encoded text. And the Image Format combo box indicates in what format the image file must be generated. (An image file is generated from the encoded text data, and this file is then used in the output document.)

 

ImageDump

 

The Image File Settings dialog (accessed by clicking the Image File Settings button) enables you to give a name for the image file that will be created. You can choose not to provide a name, in which case StyleVision will generate a name.

 

© 2017-2023 Altova GmbH