108. viewObject

Parameter syntax:

[ '[implicitElement]' ]?
    S [ attribute_name|'-' 
        S ['anyURI'|'hexBinary'|'base64Binary'|'XML']? ]?

Opens in associated helper application, the ``object'' contained or represented by implicitly or explicitly selected element.

This command may be used, for example, to open an image in an external image viewer, to open a PDF file in Adobe Acrobat Reader, etc.

The parameter may be used to specify where to find the object of interest and also the data type of this object:


This parameter specifies the name of the attribute containing the URL of the object or directly containing the object data encoded in 'hexBinary' or in 'base64Binary'.

If this parameter is absent (or is '-'), it is the selected element itself which contains the URL of the object or which directly contains the object data in 'hexBinary', 'base64Binary' or XML formats.

anyURI, hexBinary, base64Binary, XML

Specifies how the object is ``stored'' in the element or in the attribute. Data type 'XML' is only allowed for elements (typically a svg:svg or a mml:math element).

If this parameter is absent, the data type is found using the grammar of the document. Of course, this cannot be guessed for documents conforming to a DTD (too weakly typed) and also for invalid documents conforming to a W3C XML or RELAX NG schema.

When the parameter is absent, this command displays a dialog box allowing the user to choose the attribute or element of interest from a list.

Helper applications are declared using the Preferences dialog box, Helper Applications section. This registry is searched to find an application capable of opening the contents of the selected attribute or element. When no suitable helper application is found in this registry, the user is prompted to specify one.

Note that this command considers that the default viewer (specified in the Preferences dialog box, Helper Applications section, Default viewer field; typically a Web browser) should be able to open HTML, text, GIF, JPEG and PNG files[6]. Therefore, in last resort, it may end up invoking the default viewer.


viewObject [implicitElement]
viewObject fileref anyURI
viewObject - XML
viewObject [implicitElement] {http://www.w3.org/1999/xlink}href

See also editObject.

[6] Command viewObject also considers that the default viewer should be able to open URLs starting with "http://" and "https://". DocBook example: this is handy for displaying <ulink url="http://www.xmlmind.com/xmleditor/"/>.