Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Denormalize xml data

From: "Joe Fawcett" <joefawcett@---------.------>
To: 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
> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent