🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #9316

XPath et la difficult� de son �criture.

#9316
From: Rapha�l THERY
Date: Fri, 27 Apr 2001 09:57
32 lines
2173 bytes
Bonjour, je n'arrive pas utiliser XPath en vue d'offrir une navigation entre
noeud fils de m�me nature.

Soit le fichier XML suivant :
<root>
<fils nature="1" nom="az"> ...</fils>
<fils nature="1" nom="bz"> ...</fils>
<fils nature="2" nom="cz"> ...</fils>
<fils nature="3" nom="dz"> ...</fils>
<fils nature="1" nom="ez"> ...</fils>
<fils nature="2" nom="fz"> ...</fils>
<fils nature="2" nom="gz"> ...</fils>
<fils nature="1" nom="hz"> ...</fils>
</root>

Soit une feuille de style pour les noeuds de nature "1" (mais .
la variable $Fichier repr�sente le fichier XML cit� ci-dessus en prenant en
compte le noeud root (select="document()/root")

l'expression suivante me permet d'acceder au noeud dont le nom correspond �
mon flux
<xsl:value-of select="$Fichier/fils[@nature='1'][@nom =
current()/@nom]/@Name" />

par contre je souhaite acc�der au noeud pr�c�dent et suivant.... donc (� mon
avis un truc) du genre :
<xsl:value-of select="$Fichier/fils[@nature='1'][@nom =
current()/@nom][preceding-sibling::fils[position()=1]]/@Name" />
(comme vu dans la spec XPATH) mais cela ne marche pas !

Auriez vous une id�e pour r�soudre ce probl�me !
Rapha�l
Technical Details
Message-ID: <HobG6.253$Lw4.656473@nnrp4.proxad.net>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!proxad.net!feeder2-1.proxad.net!nnrp4.proxad.net.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,935aebe3b6637edb,start
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-04-27 02:57:59 PST
Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!proxad.net!feeder2-1.proxad.net!nnrp4.proxad.net.POSTED!not-for-mail
From: "Rapha�l THERY" <raphael.thery@free.fr>
Newsgroups: fr.comp.text.xml
Subject: XPath et la difficult� de son �criture.
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <HobG6.253$Lw4.656473@nnrp4.proxad.net>
Date: Fri, 27 Apr 2001 09:57:59 GMT
NNTP-Posting-Host: 195.115.154.77
X-Complaints-To: abuse@proxad.net
X-Trace: nnrp4.proxad.net 988365479 195.115.154.77 (Fri, 27 Apr 2001 11:57:59 CEST)
NNTP-Posting-Date: Fri, 27 Apr 2001 11:57:59 CEST
Organization: Guest of ProXad - France