Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: XSL to return a node-set [Thread Next] Re: XSL to return a node-setTo: NULL Date: 3/6/2006 4:48:00 AM It worked. Many thanks. "Dimitre Novatchev" wrote: > > I have tried using the following but it returns only the first <child> > > node. > > <xsl:variable name="Temp" select="/root/child[substring(@id,1,2)='Id']"/> > > Use > xsl:copy-of > instead of > xsl:value-of > > and you'll be able to see that the XPath expression actually selects 2 > nodes. > > This can also be verified by: > > count(="/root/child[substring(@id,1,2)='Id']) > > > Cheers, > Dimitre Novatchev. > > > "RN" <RN@d...> wrote in message > news:594318E2-4708-41FB-B2A1-9D454D6B8053@m...... > > Would it be possible to collect the following node-set using XSL in a > > variable for the XML provided below based on the condition that the value > > of > > "id" attribute of <child> has the first 2 characters as "Id"? If yes, how > > do > > I draft the query? > > > > Nodeset > > ---------- > > <child id='Id01'> > > <ttt/> > > </child> > > <child id='Id03'> > > <bbb/> > > </child> > > > > XML > > ----- > > <root> > > <child id='Id01'> > > <ttt/> > > </child> > > <child id='myId02'> > > <hhh/> > > </child> > > <child id='Id03'> > > <bbb/> > > </child> > > </root> > > > > I have tried using the following but it returns only the first <child> > > node. > > <xsl:variable name="Temp" select="/root/child[substring(@id,1,2)='Id']"/> > > > > > > > > > > > > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
