Jump to content

Get the value at node where node name is in the variable


dkaur

Recommended Posts

Following is my XML and on my report I have to display fields based on my sort fields..I have added my XSL below where I am trying to get values at node based on my sortvariable but it just displays text..I am not sure how to achieve this..<NewDataSet> <header> <title>CONDOMINIUM LISTINGS</title> <sortfields> <sortvariable>assessments</sortvariable> <sortname>Assessments</sortname> </sortfields> <sortfields> <sortvariable>taxes</sortvariable> <sortname> Taxes</sortname> </sortfields> </header> <listing_data> <list_number>71179543</list_number> <tax_year>2010</tax_year> <acre>18.37</acre> <assessments>161000</assessments> <taxes>44456.00</taxes> <block>21done</block> <nof_bedrooms>56</nof_bedrooms> <nof_full_baths>29</nof_full_baths> <nof_half_baths>33</nof_half_baths> <nof_rooms>65</nof_rooms> </listing_data> <listing_data> <list_number>71170001</list_number> <tax_year>2010</tax_year> <acre>1.37</acre> <assessments>501000</assessments> <taxes>19844.00</taxes> <block>15e</block> <nof_bedrooms>6</nof_bedrooms> <nof_full_baths>9</nof_full_baths> <nof_half_baths>3</nof_half_baths> <nof_rooms>18</nof_rooms> </listing_data> <listing_data> <list_number>71170005</list_number> <tax_year>2009</tax_year> <acre>1.37</acre> <assessments>400000</assessments> <taxes>5844.00</taxes> <block>10g</block> <nof_bedrooms>5</nof_bedrooms> <nof_full_baths>2</nof_full_baths> <nof_half_baths>3</nof_half_baths> <nof_rooms>10</nof_rooms> </listing_data></NewDataSet>Here is part of my XSL <table width="100%" class="ForcedLabel" cellpadding="0" cellspacing="0"><xsl:for-each select="//listing_data"> <xsl:variable name="v_listnumber"> <xsl:value-of select="list_number"/> </xsl:variable> <tr> <td> <xsl:value-of select="list_number"/> </td> <xsl:for-each select="//header/sortfields"> <xsl:variable name="v_sortvariable"> <xsl:value-of select="sortvariable"/> </xsl:variable> <xsl:variable name="v_sort"> <xsl:value-of select="concat('//NewDataSet/listing_data[list_number = $v_listnumber]/', $v_sortvariable)"/> </xsl:variable> <td> <xsl:attribute name="style"> <xsl:if test="//header/show_agentinformation != 'True'">border-bottom: solid 1px #C0C0C0;</xsl:if> </xsl:attribute> <xsl:value-of select="$v_sort"/> </td> </xsl:for-each> </tr> </xsl:for-each> </table>Thanks.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...