Article View: fr.comp.text.xml
Article #8760Re: XSL: Comment savoir si un element fils est present dans un noeud?
From: Thomas Broyer
Date: Mon, 23 Jul 2001 10:31
Date: Mon, 23 Jul 2001 10:31
29 lines
1778 bytes
1778 bytes
In <3B5BD704.F721E6B8@alcion.fr>, Eric TOURNIER wrote:
>> le fait est que le fils1 et le fils2 peuvent etre present ou non,
>> comment puis-je tester si l'element fils en question est present? avec
>> xsl:if et xsl:choose ca ne marche pas.
>>
>
> Faire :
>
> <xsl:template match="element-pere">
> <xsl:if test="element-fils1 != '' ">
Ton test retourne faux dans les cas suivants:
<element-pere>
<element-fils1/>
</element-pere>
et
<element-pere>
<element-fils1><foo/><bar/><baz/></element-fils1>
</element-pere>
Pas vraiment ce qu'on veut...
Alors que veut-on ?
Que l'ensemble des sous-�l�ments �element-fils1� soit vide, donc
element-fils1 = false()
ou
not(element-fils1)
Tom.
Technical Details
Message-ID:
<1454628.UtdWV9SEqC@ltgt.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!wanadoo.fr!proxad.net!feeder2-1.proxad.net!nnrp1.proxad.net.POSTED!not-for-mailReferences:
<3B4C6ABE.3AB50E16@igbmc.u-strasbg.fr> <3B5BD704.F721E6B8@alcion.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,990990f769035177 X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-07-23 03:31:06 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!wanadoo.fr!proxad.net!feeder2-1.proxad.net!nnrp1.proxad.net.POSTED!not-for-mail Message-ID: <1454628.UtdWV9SEqC@ltgt.net> From: Thomas Broyer <ptittom+news@free.fr> Subject: Re: XSL: Comment savoir si un element fils est present dans un noeud? Newsgroups: fr.comp.text.xml References: <3B4C6ABE.3AB50E16@igbmc.u-strasbg.fr> <3B5BD704.F721E6B8@alcion.fr> Lines: 29 Organization: </> User-Agent: KNode/0.5.6 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit Date: Mon, 23 Jul 2001 10:31:06 GMT NNTP-Posting-Host: 193.251.185.50 X-Complaints-To: abuse@proxad.net X-Trace: nnrp1.proxad.net 995884266 193.251.185.50 (Mon, 23 Jul 2001 12:31:06 CEST) NNTP-Posting-Date: Mon, 23 Jul 2001 12:31:06 CEST