Article View: fr.comp.text.xml
Article #350Re: Comment calculer ceci avec xsl/xpath
From: Nicolas M
Date: Fri, 30 Nov 2007 09:18
Date: Fri, 30 Nov 2007 09:18
24 lines
1891 bytes
1891 bytes
Nicolas M a �crit : > <xsl:for-each select="tokenize(my_string)"> > <xsl:variable name="label" select="."/> > <xsl:variable name="id" select="//mynode[@label=$label]/@id"/> > <xsl:value-of select="$id"/> > </xsl:for-each> > > > "Cannot select a node here: the context item is an atomic value" J'ai eu la r�ponse sur le ng anglophone : yes paths starting with // are still relative Xpaths they mean select from the current document, which means outermost ancestor of teh current node, but in a context where there is no current node, they error. you want <xs:variable name="root" select="/"/> <xsl:for-each select="tokenize(...)"> select="$root//mynode[. Nicolas
Technical Details
Message-ID:
<474fd576$0$23990$426a74cc@news.free.fr>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp5-2.free.fr!not-for-mailReferences:
<474d9b43$0$14888$426a74cc@news.free.fr> <474dabbe$0$31481$426a74cc@news.free.fr> <474e721c$0$14499$426a74cc@news.free.fr> <474e7382$0$10874$426a34cc@news.free.fr> <474eb9b3$0$13172$426a34cc@news.free.fr>Show Full Headers
Complete Article Headers
X-Google-Thread: 114f60,903a3b7f8d7bea5a X-Google-Attributes: gid114f60,public,usenet X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp5-2.free.fr!not-for-mail Date: Fri, 30 Nov 2007 10:18:46 +0100 From: Nicolas M <n.mo_AT_free.fr@nospam.invalid> User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 Newsgroups: fr.comp.text.xml Subject: Re: Comment calculer ceci avec xsl/xpath References: <474d9b43$0$14888$426a74cc@news.free.fr> <474dabbe$0$31481$426a74cc@news.free.fr> <474e721c$0$14499$426a74cc@news.free.fr> <474e7382$0$10874$426a34cc@news.free.fr> <474eb9b3$0$13172$426a34cc@news.free.fr> In-Reply-To: <474eb9b3$0$13172$426a34cc@news.free.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Lines: 24 Message-ID: <474fd576$0$23990$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 30 Nov 2007 10:18:47 MET NNTP-Posting-Host: 193.49.107.116 X-Trace: 1196414327 news-2.free.fr 23990 193.49.107.116:53767 X-Complaints-To: abuse@proxad.net