4D v14.3

PROCESS 4D TAGS

Home

 
4D v14.3
PROCESS 4D TAGS

PROCESS 4D TAGS 


 

PROCESS 4D TAGS ( inputTemplate ; outputResult ) 
Parameter Type   Description
inputTemplate  Text, BLOB in Data containing HTML tags to process
outputResult  Text, BLOB in Processed data

The PROCESS 4D TAGS command causes the processing by 4D of 4D HTML tags contained in the inputData parameter (field or variable of the BLOB or Text type) and returns the resulting data in outputData.

This command lets you carry out processing on tagged HTML code without it being necessary for the Web server to send an HTML page using a command of the WEB SEND BLOB type or that a page suffixed “.shtml” be requested via a URL. It is not even necessary for the 4D Web server to be started.

Pass the data containing the tags to be processed in the inputData parameter. This parameter can be a field or variable of the BLOB or Text type. The Text type is usually sufficient (parameters can receive up to 2 GB of text).

Compatibility note: Beginning with version 12 of 4D, when you use BLOB type parameters, the command automatically considers that the character set used for BLOBs is MacRoman. For better efficiency, it is strongly recommended to use Text type parameters for which processing is carried out in Unicode mode.

All the HTML tags of 4D are supported (4DTEXT, 4DHTML, 4DSCRIPT, 4DLOOP, etc.), even when the Web server is not started.

Note: When using the 4DINCLUDE tag outside the framework of the Web server (Web process):

  • with 4D in local mode or 4D Server, the default folder is the folder containing the database structure file,
  • with 4D in remote mode, the default folder is the folder containing the 4D application.

After command execution, the outputData parameter receives the data of the inputData parameter, along with the result of the processing of any 4D HTML tags that it contains, when applicable. If inputData does not contain any 4D HTML tags, the contents of outputData is identical to that of inputData.

The outputData parameter may be a field or a variable, but it must be of the same type as that of the inputData parameter.

This command makes it possible to store the values resulting from the processing of HTML tags in the database before they are sent.

It also permits the parsing of 4D HTML tags apart from the use of the Web server. In particular, you can use it to send e-mail messages in HTML format that contain processing of and/or references to data contained in the database via the 4D Internet Commands.

Note: This command no longer calls the On Web Authentication Database Method.

Example  

This example loads a 'template' type document, processes the tags it contains and then stores it:

 C_BLOB($Blob_x)
 C_BLOB($blob_out)
 C_TEXT($inputText_t)
 C_TEXT($outputText_t)
 
 DOCUMENT TO BLOB("mytemplate.txt";$Blob_x)
 $inputText_t:=BLOB to text($Blob_x;UTF8 text without length)
 PROCESS 4D TAGS($inputText_t;$outputText_t)
 TEXT TO BLOB($outputText_t;$blob_out;UTF8 text without length)
 BLOB TO DOCUMENT($document;$blob_out)

 
PROPERTIES 

Product: 4D
Theme: Tools
Number: 816

Different in remote mode

 
HISTORY 

Created: 4D 2004
Modified: 4D v11 SQL
Modified: 4D v12
Renamed: 4D v13

 
SEE ALSO 

4D HTML Tags

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14.3)

Inherited from : PROCESS 4D TAGS ( 4D v13.5)
Parent of : PROCESS 4D TAGS ( 4D v14 R4)