A QiQu-Command is an xml tag with 0..n parameters.
E.g. a simple command with zero parameter is <Exit />
.
All parameter to have a parameter-type assigned. The following table gives an overview of the
parameter-types known by QiQu.
Typename | Description |
text |
The content of the parameter is taken as it is. It cannot be dynamically
changed inside a script. This type is only used in the "Version" parameter of the
root script command "QiQuScript".
|
nodeReference |
This type is used, when a read access to an already defined XML-Node
(Document or Element) in the runtime-context is used. E.g. the "NodeRef" parameter of the
command "AddEle" defines the XML-Node under which an XML-Element should
be added. The value of such a parameter type must start with an '$'. |
saveNodeReference |
This type is used, when a new XML-Node is put to the runtime-context. Actually,
no core-command of QiQu uses this type, since QiQu core-commands always use
the specific parameter type "saveDocumentReference" or "saveElementReference".
The value of such a parameter type must start with an '$'. |
documentReference |
This type is used, when a read access to an already defined XML-Document
in the runtime-context is used. E.g. the "DocRef" parameter of the
command "SaveDoc" defines the XML-Document that should be saved.
The value of such a parameter type must start with an '$'. |
saveDocumentReference |
This type is used, when a new XML-Document is put to the runtime-context.
E.g.the "NewDocRef" of the command "CreateDoc" defines the reference name under
which a new XML-Document is registered in the runtime-context.
The value of such a parameter type must start with an '$'. |
elementReference |
This type is used, when a read access to an already defined XML-Element
in the runtime-context is used. E.g. the "EleRef" parameter of the
command "EchoEle" defines the XML-Element that should be printed to the console.
The value of such a parameter type must start with an '$'. |
saveElementReference |
This type is used, when a new XML-Element is put to the runtime-context.
E.g.the "NewEleRef" of the command "CreateEle" defines the reference name under
which a new XML-Element is registered in the runtime-context.
The value of such a parameter type must start with an '$'. |
saveReference |
In QiQu, we know 3 types of References (Refernce to a Property,
Reference to an XML-Element, Reference to an Attribute of an XML-Element).
The "saveReference" parameter type is used, for example, for the parameter "Ref" of the
"Set" command. Using the 3 types of References in the "Set" command has the following
effects.
-
A a Property-Reference is defined by
<Set Ref="PropertyName" Value="'a Value'" /> . This puts a
Property with the name "PropertyName" and the value "a Value" in the runtime context.
If a Property with this name already exists, it will be overwritten.
Property names have to start with a letter.
-
Using
<Set Ref="$anXmlElement" Value="'textcontent'" />
will write to the textcontent of the referenced XML-Element. Note that the Element must exist, otherwise
an exception is thrown.
-
In order to write directly to an attribute of an XML-Element, use the the "Set" command this way:
<Set Ref="$anXmlElement.attribute" Value="'textcontent'" /> .
Note that the XML-Element must exist as well. However, if there is no attribute with the name "attribute",
one will be created inside the XML-Element.
|
readReference |
See also the description for the parameter type "saveReference". The parameter "Ref" of the
"Delete" command is a "readReference" parameter. |
readFile |
This type is used, when a read access to an already defined text-file
in the runtime-context is used. E.g. the "FileRef" parameter of the
command "PrintToFile" defines the file to which will be written. |
saveFile |
This type is used, when a new text-file is put to the runtime-context.
The "NewFileRef" parameter of the "CreateFile" command defines the name under which
the file is cretated in the runtime-context. |
valueexpression |
A valueexpression is the most flexible and most often used type. Inside such a parameter it is
possible to concatenate strings, use QiQu functions and also use references. When using a property
reference, the value of the property is returned. When using an XML-Element reference ($anXmlElement),
the textcontent of this XML-Element is returned. When using a reference to an attribute of an
XML-Element ($anXmlElement.anAttribute), the value of the attribute is returned.
Some examples:
<Set Ref="Prop1" Value="'text' + OtherProp + $Element1.attr1"/>
<Set Ref="Prop2" Value="toUppercase(OtherProp + '.' + $Element)"/>
<If Condition="equals('compValue', Prop1)"/>
<If Condition="and(or(Prop1, Prop2), $Element.attr2)"/>
|
xpath |
The type "xpath" is used for the "Xpath" parameter of the commands "For" and "SelectFirst".
It defines a parameter which contains a QiQu-Xpath Expression.
A QiQu-Xpath Expression is normal XPath expression. However, QiQu references
can be used inside by escaping them with # at the beginning and end.
Example:
- a Property "Value1" is defined with the content "joe"
QiQu-XPath Expression:
//Customer[@name='#Value1#']
is evaluated to //Customer[@name='joe']
You can create completely dynamical Xpath expression that way:
- Property "ElementType" has value "Customer"
- Property "AttributeName" has value "name"
- Property "AttributeValue" has value "joe"
//#ElementType#[@#AttributeName#='#AttributeValue#']
is evaluated to //Customer[@name='joe']
|