XSLT list multiple values

I Have XML similar to this(omitted parts for brevity):

      <pageid url="/blah.aspx" name="Vacancy Application">1873</pageid>
      <memberkey emaillogin=""></memberkey>

        <ifyouhavetickedyeshowwouldyoudescribeyourdisabilitytickallthatapplytoyou record="532253c1-d727-42cd-93a6-97cd778e5ee9" sortorder="1" pageindex="2" fieldsetindex="0">
          <caption>If you have ticked 'Yes', how would you describe your disability (Tick all that apply to you.)</caption>
            <value key="c6de1932-9bba-4691-b19e-a44b5bb68c6c">I have a hearing problem</value>
            <value key="dd902bdb-89d7-4f14-ab60-4e69e803f321">I use a wheelchair</value>
            <value key="322c8e15-f722-406c-9d10-1769a2fb306e">I am dyslexic</value>


Im applying xslt and doing something like this:

        <xsl:when test="$records//fields/ifyouhavetickedyeshowwouldyoudescribeyourdisabilitytickallthatapplytoyou//value != ''">

     <xsl:value-of select="$records//fields/ifyouhavetickedyeshowwouldyoudescribeyourdisabilitytickallthatapplytoyou//value"/>


This just outputs the first value ('I have a hearing problem')

How can i make it list all the values?


Untested (replaced the very long node name with "longname")...

<xsl:for-each select="$records//fields/longname//value">
  <xsl:value-of select="."/>
<xsl:if test="not($records//fields/longname//value)">


I've updated the above, as I think the != '' is unnecessary

Your code will output all the values if you run it as an XSLT 2.0 stylesheet: XSLT 2.0 changes the behaviour of xsl:value-of so it outputs all the values, not only the first.

Need Your Help

drag drop across iFrame using Angular Directive

angularjs jquery-ui iframe jquery-ui-draggable jquery-ui-droppable

I need some controls to work with Drag &amp; Drop across iFrame. the reason i need the functionality in an iframe is because its a CMS that we are building and the any "absolute" css changes in the "

How to set x-axis with decreasing power values in equal sizes

r plot ggplot2 cdf

Currently I am doing some cumulative distribution plot using R and I tried to set x-axis with decreasing power values (such as 10000,1000,100,10,1) in equal sizes but I failed: