Re: [xsl] Getting a list of node Text()

Subject: Re: [xsl] Getting a list of node Text()
From: Nicholas Orr <nick@xxxxxxxxxxx>
Date: Wed, 20 Jun 2007 09:35:14 +1000
On 20/06/2007, at 9:14 AM, David Carlisle wrote:
once a variable has been bound to a value, it keeps that value.

Ah yes, I forgot about that one.



On 20/06/2007, at 9:22 AM, David Carlisle wrote:


<xsl:for-each select=".//Calculation">
<xsl:value-of select="."/>
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>

This was exactly what I was after. Unfortunately I can't use XSLT2, so this worked fine. Thanks for your help, and thanks also to Andrew for your ideas.


One slightly related question, is it possible to remove whitespace ( returns and spaces ) from before and after the text. So in this line from above :

<xsl:value-of select="."/>

The XML actually looks like this :

<Calculation>
<![CDATA[Table 1::Number1 & Custom 1 & External ( "Menu- Version"; "" ) & <Function Missing>]]>
</Calculation>


So, the data comes with a lot of extra whitespace. I was able to filter it on import when I was getting one node at a time after the transform (it's an import into a DB), but now that I'm getting mutliple nodes in one step, it's all coming in between each block and makes it harder to filter.

Thanks,
Nick

Current Thread