[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: select the correct value from a xml

Subject: Re: select the correct value from a xml
From: Jakub.Valenta@xxxxxxxx
Date: Tue, 26 Mar 2002 15:30:32 +0200
imagen xslt
Hi Carlos,
just use ./text() it will return only the text node childe while ignoring
all other children.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl
="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="/">
      <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="./text()" disable-output-escaping
="yes" /><BR />
            </xsl:when>

            <xsl:otherwise>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:for-each>
   </xsl:template>
</xsl:stylesheet>

br,

Jakub




"Carlos" <linux@xxxxxxxx>@lists.mulberrytech.com on 03/26/2002 02:25:21 PM

Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx

Sent by:  owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To:   <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
cc:

Subject:   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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.