Subject: RE: [xsl] Adding empty elements for alignment From: <Jarno.Elovirta@xxxxxxxxx> Date: Thu, 23 Sep 2004 14:53:10 +0300 |
Hi, > I have the following XML structure. > > SOURCE: > <table> > <row1> > <column seq="1">Value</column> > <column seq="2">Value</column> > <column seq="3">Value</column> > <column seq="4">Value</column> > <column seq="5">Value</column> > <column seq="6">Value</column> > </row1> > <row2> > <column seq="1">Value</column> > <column seq="3">Value</column> > <column seq="5">Value</column> > </row2> > </table> > > REQUIRED OUTPUT: > <table> > <row1> > <column seq="1">Value</column> > <column seq="2">Value</column> > <column seq="3">Value</column> > <column seq="4">Value</column> > <column seq="5">Value</column> > <column seq="6">Value</column> > </row1> > <row2> > <column seq="1">Value</column> > <column seq="2"/> > <column seq="3">Value</column> > <column seq="4"/> > <column seq="5">Value</column> > <column seq="6"/> > </row2> > </table> > > PROBLEM: > <row1> can contain 1 or many <column> elements. > <row2> can contain zero or many <column> elements. I want to output > empty <column> elements so <row2> columns align with <row1>. First count how many columns row1 contains, then go throught the row2 columns with a recursive template, counting up from 1, and when ever you can't find a maching column inside row2, generate an empty one. Cheers, Jarno
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] setParameter(), Luke Ambrogio | Thread | [xsl] How can I checking whether an, Eldho George |
Re: [xsl] Adding empty elements for, David Carlisle | Date | [xsl] How can I checking whether an, Eldho George |
Month |