Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL translate problem

Status
Not open for further replies.

ahevans

Technical User
Jan 27, 2006
26
GB
i have the xsl sheet below that takes a job list via xml. the problem is that the translate part only works on the first record. Any ideas why?

<xsl:stylesheet version = '1.0'
xmlns:xsl='<xsl:template match="/">
<xsl:for-each select="nhs_search/vacancy_details">
<p>
<strong>Job Reference; <xsl:value-of select="job_reference"/></strong>
<br />
<strong>Job title; </strong><xsl:value-of select="job_title"/>
<br />
<strong>Description; </strong><xsl:value-of select = "translate(job_description,'–','')" />
<br />
<strong>Salary; </strong><xsl:value-of select="job_salary"/>
<br />
<strong>Location; </strong><xsl:value-of select="job_location"/>
<br />
<strong>Close date; </strong><xsl:value-of select="job_closedate"/>
<br />
<strong>Apply at;</strong>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="job_url"/>
</xsl:attribute>
NHS Jobs
</xsl:element>
</p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
 
>[tt]<xsl:for-each select="nhs_search/vacancy_details">[/tt]
Change it to this.
[tt]<xsl:for-each select="[red]//[/red]nhs_search/vacancy_details">[/tt]

Also, your apparent hypen+space ("- ") is in fact a unicode &#xA156. Maybe that's your original intent, just not sure. But it shouldn't make thing happen only on the first encounter unless your xml preparation is defective.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top