This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: select the correct value from a xml
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 26 Mar 2002 13:07:27 -0000
- Subject: RE: [xsl] select the correct value from a xml
- Reply-to: xsl-list at lists dot mulberrytech dot com
Use <xsl:value-of select="text()"/>
And never use disable-output-escaping except in quite exceptional
circumstances - which don't apply here.
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Carlos
> Sent: 26 March 2002 12:25
> To: XSL-List@lists.mulberrytech.com
> Subject: [xsl] select the correct value from a xml
>
>
> 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