Subject: RE: [xsl] List in a variable From: "Oleg Tkachenko" <olegt@xxxxxxxxxxxxx> Date: Wed, 8 Aug 2001 11:28:18 +0200 |
Hello Nitin ! Consider you context node is <component> element: <xsl:variable name="myVar"> <xsl:for-each select="class[@type='second']"> <xsl:value-of select="@name"/> <xsl:if test="position() != last()">#</xsl:if> </xsl:for-each> </xsl:variable> --- Oleg Tkachenko Multiconn International > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Nitin Dutt > Mathur > Sent: Wednesday, August 08, 2001 9:53 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] List in a variable > > > Hello Guys, > > I want to have a variable containing a list of a attribute > of all the > occurrence of a particular tag. > > Precisely I have a xml like > > <component name="TestCom"> > <class name="Person" type="first"> > .. > .. > </class> > <class name="Address" type="second"> > .. > .. > </class> > <class name="Info" type="second"> > .. > .. > </class> > .. > .. > ... > </component> > > In the above xml type attribute of class tag can have value > either first or > second. I want to have variable containing names of all the > second classes. > For the above case I want to have a variable (say myVar) with the value > "Address#Info" where # is just a separating character between the names of > the class. > > I hope I am able to clear my requirement. > > Thanks in advance > > Nitin > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] List in a variable, Nitin Dutt Mathur | Thread | RE: [xsl] TransformerException, Michael Kay |
RE: [xsl] Problem to process direct, Michael Kay | Date | RE: [xsl] Problem with xsl:choose, Oleg Tkachenko |
Month |