import_text_block

The function import_text_block imports a stored XML Text Block structure so that it can be used in the Master Template run.

 import_text_block ( "<?xml ... >")

The result of this function is a value of type TEXT that contains a reference to a Text Block. This Text Block reference can be used in the parameter VAR of the statement TEXTBLOCK or as the default value of an EDITABLE_TEXTBLOCK question in a FORM. The Text Block reference is in an unspecified format, and it is valid only during the current Master Template run.

The parameter of the import_text_block function should be an XML representation of a Text Block. For more information about the XML format of a Text Block, refer to the Communications Manager Core Text Block XML Format topic of the Tungsten Communications Manager Core Developer's Guide.

To retrieve the Text Block XML from Repository, use the RetrieveRepositoryObject command (see the corresponding topic in the Communications Manager Core Scripting Language Developer's Guide) or you can look for the Text Block representation in he Communications Manager Core XML metadata file. The required XML should start with <tbk> node.

You need to place the retrieved XML of the Text Block inside the <content></content> section as text and make sure to escape the double quotes and slashes. For example, the code sample below demonstrates import of a Text Block that starts with an empty line followed by the "Hello" string.

TEXT tb

ASSIGN tb:= import_text_block(“<?xml version=/"1.0/" encoding=/"utf-8/"?><textblock><content><tbk xmlns=/"http:////www.aia-itp.com//Repository//3.1//TextBlockImport/" xsv=/"2.4.0/"><par font=/"normal/" indentation=/"0/" hanging-indentation=/"false/" //><par font=/"normal/" indentation=/"0/" hanging-indentation=/"false/"><txt bold=/"false/" italic=/"false/" underline=/"false/">Hello<//txt><//par><//tbk><//content><//textblock>”)

You can use the imported Text Block as a default editable Text Block in a Form. See an example of a Static Form below:

TEXT answ1
FORM “Static”
QUESTION “Editable”
EDITABLE_TEXTBLOCK
DFT tb
ANSWER answ1
TEXTBLOCK VAR answ1