![]() |
A tulip scenario file uses a simplified form of XML language. It is a set of anchors enclosed into one another (one single root anchor), containing either other anchors, text (PCDATA) or nothing.
… <BALISE att1=“val1“ att2=“val2“ att3=“val3“ ..>
<BALISE1 att1=“val1“ att2=“val2“ att3=“val3“ ..> Free text … </BALISE1> </BALISE>
<BALISE2 att1=“val1“ att2=“val2“ att3=“val3“ ../> …
The structure of XML files is described in the commands.dtd file. During compilation, Tulip compiler checks each scenario file within source lookup directory, against DTD file. A DTD file contains elements such as:
<!ELEMENT TEST_SEND (#PCDATA)> <!ATTLIST TEST_SEND PIPELINE (INPUT | COMMAND) "INPUT" METHOD CDATA "DATA" >
This declaration is compatible with the following command: <TEST_SEND METHOD=“command“> Hello TEST </TEST_SEND>
The line beginning with <!ELEMENT contains the name of the command, and (#PCDATA) means the command contains free text between the start and end anchors. If the command encloses other commands (for example, DECLARE anchor below), these commands are described within that object, with the following modifiers: * (0 or more), + (1 or more), ? (0 or 1), nothing (only 1).
<!ELEMENT DECLARE (CONSTANT*,VARIABLE*)>
The <!ATTLIST anchor defines some XML attributes which are associated to the command, with their possible values (cf PIPELINE attribute above), their default value (“INPUT” is the default value of attribute PIPELINE).
A scenario contains one single root <SEQ> anchor. It may also include a <DECLARE> section, dedicated to local variables declaration.
Hello World scenario:
<SEQ> <PRINT>Hello World!</PRINT> </SEQ>
Any free text (either within a command attribute, or between start and end anchors of some commands (PCDATA) may contain some variables/constants/traffic parameters/jokers. In those cases, the object name is inserted between “~” characters.
Example : <PRINT>Variable ~var~</PRINT> <PRINT_VAR VAR=”NOM_VAR_~nomvar~”/>
Particular cases: - If it is necessary to use “~” characters within free text, be careful it does not match an existing object, otherwise the string between ~ will be replaced by its current value. - Be careful not to include the command end anchor within free texte (ex, </PRINT>), otherwise there will be a compilation error. If necessary, insert a string variable which will contain that value (not a constant).- If the name between “~” does not correspond to any known object, the string will be sent as it is (it is not an error).
The free text PCDATA may also contain special variables called Jokers. The use of these variables permits to match a string will don’t know exactly, without having to use a dummy variable (typically used for an incoming packet). The type of jokers are the following: ~**~ : rest of line joker which matches any string until a carriage return is met. ~$$~: block joker, which can match any string. ~//~: line joker, matches a number of complete lines until the following string is met. ~1~, where “1” can be replaced by any number. Matches the specified number of characters.
|
Scenario Syntax |
![]() |