Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: How to select particular items from repeating 'generic' attributes? How to select particular items from repeating 'generic' attributes?To: NULL Date: 2/6/2006 10:38:00 AM Hi, I'm pretty new to XSL, and I've bumped into what is probably (hopefully) a simple problem. I need to convert a simple xml document containing just repeated 'generic' data blocks of: <record> <data>Bob</data> <data>Smith</data> ... </record> to: <person> <firstname>Bob</firstname> <lastname>Smith</lastname> ... </person> The source xml contains the same number of <data> elements for each record, are in a consistent order, with no omissions. I've figured out how to use foreach to iterate over the person records, but can't see how to select the nth occurence of <data> within each record. Basically I think I need: <xsl foreach record> <person> <firstname><xsl valueof "first data"></firstname> <lastname><xsl valueof "2nd data"></lastname> ... </person </xsl foreach> But I've got no idea how to actually get the 'first data', 'second data', etc... Thanks in advance, -Dave | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
