'how can I Create a list variable from other lists in a condition

I have a list requiredStyles that is composed of other list depending on a series variable.

but it's not working correctly I get the output: Warning: will not be created contain a cell paragraph with Adiv Adiv2 ADiv3 AC1 C1 fld-c1 ACount AJur

It doesn't seem to be creating requiredStyles as a list. Please assist.

requiredStyles

<xsl:variable name="requiredStyles">
     <xsl:choose>
        <xsl:when test="$series = 'Alpha'">
            <xsl:value-of select=" ( $styleList1 , $styleList2 , $styleList3 , $styleList4  ) "/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select=" ( $styleList1 , $styleList2 , $styleList3 ) "/>
        </xsl:otherwise>
    </xsl:choose>                                               
</xsl:variable>
<xsl:choose>
<xsl:when test=" string-join( w:tr[ w:tc[1]/w:p[ w:pPr/w:pStyle[ @w:val = ( $requiredStyles ) ] ] ]/w:tc[2]//w:t , '' ) = '' ">
    <xsl:call-template name="outputErrorMessage">
        <xsl:with-param name="messageText" as="xs:string">
             <xsl:variable name="temp" as="xs:string+">
                  <xsl:text>Warning: will not be created contain a cell paragraph with "</xsl:text>
                  <xsl:value-of select=" ( $requiredStyles ) " separator='", or "'/>
                  <xsl:text>" style.</xsl:text>
             </xsl:variable>
             <xsl:sequence select=" string-join( $temp , '' ) "/>
        </xsl:with-param>
    </xsl:call-template>
</xsl:when>
<xsl:otherwise>
...

</xsl:otherwise>


Solution 1:[1]

Moving it to and xpath if did the trick

Fiddle solution

<xsl:variable name="requiredStyles2" as="xs:string+" 
      select="
            if ($series = 'Alpha') 
            then 
              ( $style1 , $style2 , $style3 , $style4  )
            else
              ( $style1 , $style2 , $style4  )
            "
    />

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1