40. extractObject

Parameter:

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

This command is the opposite of setObject. It can be used to save to disk 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.

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 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.

file_name

Specifies the name of the file created by this command.

'%T' specifies a temporary file name automatically generated by this command.

If specified file name ends with '.%X', this string is replaced by a suffix corresponding to the format of the object. For example, this command can detect that the data compressed with gzip before being encoded in base64Binary is in fact GIF image data and in such case, it will replace '.%X' by '.gif'.

If this parameter is absent, a chooser dialog box is displayed to let the user specify where the object file is to be created.

This command returns the name of the file it has created.

Examples:

extractObject
extractObject fileref anyURI
extractObject -
extractObject data - /tmp/extracted.%X
extractObject - XML %T