Re: [xsl] how get the correct value?

Subject: Re: [xsl] how get the correct value?
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Mon, 08 Apr 2002 13:57:16 +0200
Carlos wrote:
if i have this xml:
<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>5.gif
                <TEXTO>asdf asfd sfd afas fasfd</TEXTO>
            </IMAGEN>
             <IMAGEN>
                 <TEXTO>44.gif</TEXTO>
            </IMAGEN>
</PARRAFOS>

how , with xslt, can i get:
3.gif <br/>
5.gif<br/>
44.gif

Can you explain us which text you want to be in the output? I can see only one common criterion - ".gif" substring, so just for fun llok at this:


<xsl:template match="text()">
	<xsl:if test="contains(.,'.gif')">
		<xsl:value-of select="normalize-space()"/>
		<xsl:if test="ancestor::IMAGEN/following-sibling::IMAGEN">
			<br/>
			<xsl:text>&#xA;</xsl:text>
		</xsl:if>
	</xsl:if>
</xsl:template>

--
Oleg Tkachenko
Multiconn International, Israel


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread