xsl-list
[Top] [All Lists]

Re: [xsl] Help on node selection

2010-08-27 06:53:10
<N1>120,120,110</N1>
<N2>120,120</N2>

<xsl:template match="data">
  <N1><xsl:value-of select="string-join(row[N1 eq '1']/N2, ', '))"/></N1>
  <N2><xsl:value-of select="string-join(row[N1 eq '2']/N2, ', '))"/></N2>
</xsl:template>


-----Message d'origine-----
De : Andrew Welch [mailto:andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com]
Envoyé : vendredi 27 août 2010 13:45
À : xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Objet : Re: [xsl] Help on node selection

My question is pretty basic, so far.

Suppose I get an XML document

<data>
     <row>
                     <N1>1</N1>
     <N2>120</N2>
     </row>
     <row>
                     <N1>1</N1>
     <N2>120</N2>
     </row>
     <row>
                     <N1>2</N1>
     <N2>120</N2>
     </row>
     <row>
                     <N1>2</N1>
     <N2>120</N2>
     </row>
     <row>
                     <N1>1</N1>
     <N2>110</N2>
     </row>
</data>
...
Is called on each matching node...(thus 3 times here), rather than once, and 
then gets some loop to individually treat each node from the list.
How can I proceed ?

You need to provide the expected output for that input...


--
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--