|
|
|
<emit source="values"></emit>
Provided by module: Tags: RXML tags
Iterates over the component values of a string or a compound
value. If it's a string, it's split into pieces using a
separator string, and the plugin then iterates over the pieces. If
it's a compound value like an array then the plugin iterates over its
elements.
Attributes
- values="mixed"
-
The value to iterate over. This attribute is required unless the
"variable" or "from-scope" attribute is used.
- variable="name"
-
Name of a variable from which the value are taken.
- split="string" (NULL)
-
The string to split a string value with. Supplying an empty string
results in the string being split between every single character.
This has no effect if the value isn't a string.
- nosplit
-
If specified then the value isn't split, even when it is a string.
Instead the plugin only evaluates its contents once using the whole
string.
This is useful if a value might either be a single string or
multiple strings as an array, and you want to iterate over each full
string.
- advanced="{lines, words, csv, chars}"
-
If the value is a string it can be split into multiple fields
by using this attribute:
- lines
-
The input is split on individual line-feed and carriage-return
characters and in combination. Note that the separator characters
are not kept in the output values.
- words
-
The input is split on the common white-space characters (line-feed,
carriage-return, space and tab). White-space is not retained in
the fields. Note that if a field ends with one of the punctuation
marks '.', ',', ':', ';',
'!' or '?', the punctuation mark will be removed.
- chars
-
(Characters) The input is split into individual characters.
- csv
-
(Comma-separated values) This input is first split into lines,
and the lines then split into fields on
',' and ';' according to CSV quoting rules.
Note that this results in a two-dimensional result.
- case="{upper, lower}"
-
Change the case of each returned value.
- trimwhites
-
Trim away all leading and trailing white space charachters from each
returned value.
- randomize="{yes, no}"
-
Outputs the values in random order if it has the value 'yes'.
- distinct
-
If specified, values are only output once even if they occur several times.
- from-scope="name"
-
Iterate over a scope like a mapping. &_.index; gets the
name of each variable in it and &_.value; gets the
corresponding value.
-
&_.index; (provided by Tags: RXML tags)
The index of one element. This is set if the value being iterated
over is a mapping/scope or a multiset.
-
&_.value; (provided by Tags: RXML tags)
The value of one element or substring if a string is being split.
|
|