The value attribute allows the programmer to specify the value of an element using an attribute. For simple values such as numbers or strings this provides for a slighly simpler, briefer syntax. There is a subtle difference also: When the value attribute is set, the wsstrip attribute is ignored and whitespace stripping is set to false for the element.
<instruction>
<input value="Hello World!"/>
</instruction>
is equivalent to:
<instruction>
<input>Hello World!</input>
</instruction>
The encoder attribute allows the programmer to specify an encoding for an IKO element. The value returned by (or stored by) the element will be encoded against the scheme specified. The following encodings are currently supported:
none*No encoding, this is the default
nameData is formatted to a valid name. A name is a string made up of only alphanumeric characters. Other characters will be removed. See http://www.w3.org/TR/REC-xml/#NT-Name
digitsFilters the value to digits only [0-9]. Other characters are dropped. Based on the standard C Library
xmlThe data is encoded to be xml safe. Data encoded as xml can be inserted into an xml object.
sqlThe data is encoded to be sql safe. Data encoded as sql can be inserted into an sql query.
urlThe data is encoded to be safe for passing through a URL query string.
base64Encodes the data in base64.
hexEncodes the data as hex.
The process attribute is closely related to the ecnoder attribute, it allows the programmer to indicate whether the encoder attribute should encode or decode the data.
encode*The data is encoded to the specified encoding. This is the default.
decodeThe data is decoded using the specified encoding.
The context attribute allows the programmer to specify the name of an input by reference. This allows for dynamic inputs and can be used as a convenience.
Posted sysparm: favourite_color=green
<instruction>
<output space="store" value="mySysparm" />
<input value="favourite_color" />
</instruction>
<instruction>
<input space="sysparm" context="store" value="mySysparm" />
</instruction>
green This example assumes the posted sysparm "favourite_color" has a value of 'green'. The sysparm itself is output in the second instruction statement, the name of the sysparm to be output is specified by the store mySysparm.
The wsstrip attribute allows the programmer to specify how white space is handled. When wsstrip is true the leading and trailing white space is trimmed. The white space characters trimmed are standard XML whitespace characters; including space, tab, return and new line. By default, wsstrip is set to true. However, when the value attribute is set, the wsstrip attribute is ignored and whitespace stripping is set to false for the element.
<instruction xmlns="http://www.obyx.org">
<input wsstrip="true">
[<iteration operation="repeat">
<control value="1" />
<body wsstrip="true">
<instruction>
<input value="foo" />
</instruction>|
<instruction>
<input value="fim" />
</instruction>|
<instruction>
<input value="fam" />
</instruction>
</body>
</iteration>]
</input>
</instruction>
[foo|fim|fam]
<instruction xmlns="http://www.obyx.org">
<input wsstrip="true">
[<iteration operation="repeat">
<control value="1" />
<body wsstrip="false">
<instruction>
<input value="foo" />
</instruction>|
<instruction>
<input value="fim" />
</instruction>|
<instruction>
<input value="fam" />
</instruction>
</body>
</iteration>]
</input>
</instruction>
returns same values but with the white space preserved:
[ foo| fim| fam ]