|
Subject: RE: [xsl] select the correct value from a xml From: "WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1)" <adam_watkin-jones@xxxxxx> Date: Tue, 26 Mar 2002 13:24:53 -0000 |
How about something like
<xsl:for-each select="PARRAFOS/IMAGEN">
<xsl:variable name="sGif" select="normalize-space(text()[1])"/>
<xsl:choose>
<!-- if is not null -->
<xsl:when test="$sGif">
<!-- show the IMAGEN value -->
<xsl:value-of select="$sGif"/><BR/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
-----Original Message-----
From: Carlos
In this XML file i want to select the 3.gif value or the 2.gif value. for
this purpose i have make the next (below) xslt file (is ashort par tof the
file):
The XML file:
<PARRAFOS>
<IMAGEN>3.gif
<TEXTO>asdf asfd sfd afas fasfd</TEXTO>
<TEXTO>asdf asfd sfd afas fasfd</TEXTO>
<TEXTO>asdf asfd sfd afas fasfd</TEXTO>
<TEXTO>asdf asfd sfd afas fasfd</TEXTO>
</IMAGEN>
<IMAGEN>2.gif
<TEXTO>asdf asfd sfd afas fasfd</TEXTO>
</IMAGEN>
</PARRAFOS>
The XSLT short part:
<xsl:for-each select="PARRAFOS/IMAGEN">
<xsl:choose>
<!-- if is not null -->
<xsl:when test="normalize-space() != ''">
<!-- show the IMAGEN value -->
<xsl:value-of select="." disable-output-escaping="yes" /><BR/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
i want to select only the 3.gif or 2.gif value and not the TEXTO value
i want to present:
3.gif<BR/>
2.gif<BR/>
how can i make this whit the xslt file?
what i must to change in my xslt file?
thanks
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] select the correct value , Michael Kay | Thread | Re: [xsl] select the correct value , Jakub . Valenta |
| [xsl] repeating elements, Joeri Belis | Date | Re: [xsl] select the correct value , Jakub . Valenta |
| Month |