100. setObject

Parameter syntax:

[attribute_name|'-']? S [data_type|'-']? S ['gzip'|'-']? S [URL_or_file]?

data_type --> 'anyURI'|'hexBinary'|'base64Binary'|'XML'
              [ '[' file_extension [',' file_extension]* ']' ]?

Interactive command displaying a dialog box letting the user change the object (generally an image) represented by explicitly selected element.

attribute_name

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.

data_type (anyURI, hexBinary, base64Binary, XML)

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

If this parameter is absent (or is '-'), 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 for invalid documents conforming to a W3C XML or RELAX NG schema.

A data type may optionally be followed by a list of one or more file extensions. See examples below. This list is used when a file chooser dialog is displayed to let the user specify which file to use.

gzip

If this parameter is specified, object data is compressed using gzip before being encoded in 'hexBinary' or in 'base64Binary'.

This parameter is ignored for 'anyURI' and 'XML' data types.

If this parameter is absent (or is '-'), data is not compressed before being encoded.

URL_or_file

Specifies the source of the object.

If this parameter is absent, the dialog box may be used to specify this source file.

Examples:

setObject
setObject src anyURI
setObject fileref anyURI[png,jpg,jpeg,gif,svg,svgz]
setObject - hexBinary gzip
setObject location - - file://localhost/icons/apache_pb.gif
setObject - XML - C:\graphics\logo.svgz
setObject - XML[svg]