🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: je voudrais le grand-p�re XPATH

#8732
From: Rapha�l THERY
Date: Wed, 22 Aug 2001 07:01
61 lines
2874 bytes
Excellent, j'en reste baba, toute ma gratitude !

Rapha�l

"Thomas Broyer" <ptittom+news@free.fr> a �crit dans le message news:
15601582.eYUQgxmLvF@ltgt.net...
> In <Jkug7.266$aJ3.1169557@nnrp3.proxad.net>, Rapha�l THERY wrote:
> > soit le flux xml suivant
> > <dir>
> >     <inclusion pattenr="*.java" mode="propag" />
> >     ...
> >     <dir>
> >         <exclusion pattenr="*.bak" />
> >         <dir>
> >             <inclusion pattern="*.java" />
> >         </dir>
> >     </dir>
> > </dir>
> >
> > en �crivant une r�gle commune sur les inclusions, exclusions
(xsl:template
> > match="inclusion|exclusion")
> > je souhaite d�tecter si un fils d'un anc�tre d�finis d�j� la m�me r�gle.
> >
> > Question(s) :
> > - Comment identifier tous les anc�tres � l'exculsion du parent m�me
> > (ancestor - parent) ?
>
> ancestor::*[position > 1]
> Le parent est forc�ment le premier anc�tre, si on s�lectionne seuls les
> anc�tres dont la position n'est pas la premi�re on supprime bien le parent
> de la liste.
>
> > - Dans la mesure o� la r�gle est commune comment �crire l'expression
pour
> > en d�duire le nom ?
>
> ???
> name() ?
>
> > Actuellement j'arrive � un truc comme cela :
> > =>
> >
>
"ancestor::*/child::inclusion[@mode='propag'][@pattern=current()/@pattern]"
>
> Utilise and plut�t que plusieurs pr�dicats, c'est en g�n�ral plus rapide,
> et �a correspond bien � ce que tu veux.
>
> > =>
> >
>
"ancestor::*/child::exclusion[@mode='propag'][@pattern=current()/@pattern]"
> > la fusion en
> > =>  "ancestor::*/child::*[name() =
> > current()/name()][@mode='propag'][@pattern=current()/@pattern]"
> > provoque une erreur.
>
> name() = name(current())
>
> Tom.
Technical Details
Message-ID: <HNIg7.883$fs1.1244304@nnrp1.proxad.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!194.149.160.21!isdnet!wanadoo.fr!proxad.net!feeder2-1.proxad.net!nnrp1.proxad.net.POSTED!not-for-mail
References: <Jkug7.266$aJ3.1169557@nnrp3.proxad.net> <15601582.eYUQgxmLvF@ltgt.net>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,f74fa31dcdf12d11
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-08-22 00:01:59 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!194.149.160.21!isdnet!wanadoo.fr!proxad.net!feeder2-1.proxad.net!nnrp1.proxad.net.POSTED!not-for-mail
From: "Rapha�l THERY" <raphael.thery@free.fr>
Newsgroups: fr.comp.text.xml
References: <Jkug7.266$aJ3.1169557@nnrp3.proxad.net> <15601582.eYUQgxmLvF@ltgt.net>
Subject: Re: je voudrais le grand-p�re XPATH
Lines: 63
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <HNIg7.883$fs1.1244304@nnrp1.proxad.net>
Date: Wed, 22 Aug 2001 07:01:59 GMT
NNTP-Posting-Host: 195.115.154.77
X-Complaints-To: abuse@proxad.net
X-Trace: nnrp1.proxad.net 998463719 195.115.154.77 (Wed, 22 Aug 2001 09:01:59 CEST)
NNTP-Posting-Date: Wed, 22 Aug 2001 09:01:59 CEST
Organization: Guest of ProXad - France