|
Global and local
variables
An XML file can contain variables whose
values can change in different files or in one file during the import process.
Currently, there are no variables with preset names or values. You can define
any number of variables you need. There are variables of two types - static and
SQL. The values of static variables are set explicitly at the moment when the
XML file is created (but the value of a variable may change in different places
of the file). The value of an SQL variable is the result of an SQL query.
Sample static variable:
<VARIABLE
name="FORM"
type="static"
onerror="break">DEF_PROF</VARIABLE>
Sample SQL variable:
<VARIABLE
name="TYPE_ID_SYSTEM_ID"
type="SQL"
onerror="break">
<QUERY>
SELECT SYSTEM_ID
FROM DOCSADM.DOCUMENTTYPES WHERE TYPE_ID = 'DEFAULT'
</QUERY>
</VARIABLE>
The value of a variable can be used in
any place of an XML file by inserting the name of the variable enclosed by
percent characters.
Example:
<PROFILE
form="%FORM%">
Or
<DOCUMENT .>
<SEARCH .>
<QUERY>
SELECT DOCNUMBER FROM DOCSADM.PROFILE WHERE DOCUMENTTYPE = %TYPE_ID_SYSTEM_ID%
</QUERY>
</SEARCH>
.
</DOCUMENT>
Variables can be global (defined in the
program settings) or local (defined in the XML file).
Please see the detailed description of
the VARIABLE element
|