Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Denormalize xml data [Thread Next] Re: Denormalize xml dataTo: NULL Date: 3/3/2007 9:03:00 AM I think you can treat this as a grouping problem. Select the distinct Records based on Title and Chapter and then add the sections. There are examples at http://www.jenitennison.com/xslt/grouping/muenchian.xml for version 1.0 but it's easier in version 2.0, if you're using Saxon for example rather than Microsoft libraries. Search for xsl:for-each-group. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name <cyndi_r2000@y...> wrote in message news:1172867613.316990.142560@t...... > Hello: > > I'm trying to use XSLT to denormalize some xml data. > > Here's my input xml: > <Records> > <Record> > <Title>ABC</Title> > <Chapter>1</Chapter> > <SectionNumber>1.1</Section> > <SectionContent>This is the first section</SectionContent> > <Record> > <Record> > <Title>ABC</Title> > <Chapter>1</Chapter> > <SectionNumber>1.2</Section> > <SectionContent>This is the second section</SectionContent> > <Record> > <Records> > > How can I use XSLT to transform this to: > <Records> > <Title>ABC</Title> > <Chapter>1</Chapter> > <Sections> > <Section> > <SectionNumber>1.1</Section> > <SectionContent>This is the first section</ > SectionContent> > </Section> > <Section> > <SectionNumber>1.2</Section> > <SectionContent>This is the second section</ > SectionContent> > </Section> > </Sections> > <Records> > > Any help is most appreciated - thanks!! > > Best, > Cyndi > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
