Home > Contents > Index >
ISINLIST
Determines whether an item is in a comma-separated string or string list.
Syntax
<ISINLIST ITEM="ITEM_NAME" STR="STR_VALUE" [LIST="LIST_NAME"]/>Parameters
ITEM (required)
- Specify the item to check for in
LIST_NAME
.
STR (required)
- String to check for occurrence of
ITEM_NAME
. The string consists of a comma-separated list of items.
LIST (optional)
- List to check for occurrence of
ITEM_NAME
. IfLIST_NAME
is not a list, an error is inserted into the output and processing may stop ifxmldebug=true
in the Sites properties file.
Description
Determines whether an item is in a comma-separated string or string list. If
STR
orLIST
is not specified or is empty, the item cannot be found and the value oferrno
is unchanged.
Note
This does not work on lists created from resultsets or search results.
The column values of the current row of a list can be obtained using the syntax,
List.colname
whereList
is the name of the list andcolname
is the name of the column in the list.
Note
In the case of StringLists, the values can be obtained by using List.Item.
You can use the following attributes to return information about the list using the syntax,
List.attname
, whereattname
can be one of the following attributes:
#numRows
Number of rows in this list#curRow
Current row in this list.#moreRows
Boolean (true/false) to indicate whether there are more rows following the current row.#numCols
Number of columns in this list.@<colname>
Only used on lists that contain resultsets. Contents of the file in the specified column if the colname begins with "url".For example,
MyList.#numRows
returns the number of rows in the listMyList
.MyList.@urlheader
retrieves the contents of the file specified by the column urlheader.The value of a list is maintained during the processing of a page request. If the list contains a resultset, the resultset is maintained independently of a list that uses it.
Error Numbers
The possible values of
errno
include:
Value Description 1 Item was found. 0 Item was not found.Example
The following example determines whether the string assigned to
MyItem
is one of the elements inMyStr
:<SETVAR NAME="MyItem" VALUE="dog"/> <SETVAR NAME="MyStr" VALUE="horse,dog,monkey"/> <SETVAR NAME="errno" VALUE="0"/> <ISINLIST ITEM="Variables.MyItem" STR="Variables.MyStr" /> <IF COND="Variables.errno=1"> <THEN> <CSVAR NAME="Variables.MyItem"/> is in string. </THEN> <ELSE> <CSVAR NAME="Variables.MyItem"/> is not in string. </ELSE> </IF>Running this code yields the following output:
dog is in string.See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.