Manage flags in xslt? -
all, searching in list of fields has type clob , writing separed comma [field1, field2, ... fieldn]
my problem how identify first matched field write without comma ( can't use position() because first field matched can first of list or last of list)
i want make algorithm in xslt,
variable is_first = true; if(is_first) { smthng; isfirst = false; }
actually not possible make in xslt since variable immutable. there workarounds have specify need in more details.
edit:
if input string values separated commas...
<xsl:variable name="inputstring" select="'field1,field2,field3a,field4,field3b'" /> ... use tokenize() functions...
<xsl:variable name="tokenized" select="tokenize($inputstring, ',')" /> ... , select items corresponding condition
<!-- select item corresponding condition (e.g. contains 3). take first 1 if there several such items --> <xsl:value-of select="$tokenized[contains(., '3')][1]" /> edit2:
you can use separator attribute of xsl:value-of (xslt 2.0) output of delimited values.
assuming following variable
<xsl:variable name="list"> <item>first</item> <item>second</item> <item>third</item> </xsl:variable> this <xsl:value-of select="$list/item" separator="," /> makes desired output first,second,third
Comments
Post a Comment