Use the select attribute in the for-each to only choose the field elements that
you want.
<xsl:for-each select="field[(_at_)noUpdate = 'true']">
-----Original Message-----
From: Hans Pickelmann | Nürnberg [mailto:info(_at_)dotnetjunkies(_dot_)de]
Sent: Monday, May 24, 2004 10:20 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] xsl schould render a vbs-Array
Hello,
i want to render xml-nodes to a vbs array.
but i don't want to have an empty entry at the end of the array.
my xml looks like:
<fieldnameArray>
<field noUpdate="true">
<fieldname>bei_id</fieldname>
</field>
<field noUpdate="false">
<fieldname>bei_template</fieldname>
</field>
<field noUpdate="false">
<fieldname>bei_text</fieldname>
</field>
</fieldnameArray>
and here my xsl
...
<xsl:apply-templates select="fieldnameArray" />
<xsl:template match="fieldnameArray">
no_update_fields=Array("<xsl:for-each select="field" ><xsl:if test="@noUpdate =
'true'"><xsl:apply-templates select="./fieldname"
/><xsl:if test="position()!=last()">", "</xsl:if></xsl:if></xsl:for-each>")
</xsl:template>
if the last noUpdate-attribute is false there will always be an empty
entry in my vbs-array
Any help would be greatly appreciated.
greetinx Hans
___________________________________
Hans Pickelmann
PULSAR interactive media GmbH
Online Development
Forsterstraße 100 Durchwahl: +49 (0)911 / 416 000 73
90441 Nürnberg Fax: +49 (0)911 / 416 000 75
Germany Mobil: +49 (0)170 / 903 42 43
E-Mail: mailto:hp(_at_)pim(_dot_)de
Internet: http://pim.de
--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--