Subject: RE: [xsl] How to create tables from this...? From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 23 Apr 2002 17:15:37 +0100 |
You want something like <xsl:template match="side-effects"> <xsl:apply-templates select="paragraph | common"/> </ <xsl:template match="paragraph"> ... </xsl:template> <xsl:template match="common"> <table> <tr> <td><xsl:apply-templates/></td> <td><xsl:apply-templates select="following-sibling::less-common[1]/*"/></td> <td><xsl:apply-templates select="following-sibling::rare[1]/*"/></td> </tr> </table> </ Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of > Emma Larsson > Sent: 23 April 2002 15:45 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] How to create tables from this...? > > > Hi, > > Below is a snippet from one of the XML files I am working with. > > <driving/> > <side-effects> > <paragraph>blabla</paragraph> > <common> > <paragraph>blabla</paragraph> > </common> > <less-common> > <paragraph>blabla</paragraph> > </less-common> > <rare> > <paragraph>blabla</paragraph> > <paragraph>blabla</paragraph> > </rare> > <paragraph>blabla</paragraph> > <paragraph>blabla</paragraph> > <common> > <paragraph>blabla</paragraph> > </common> > <very-rare> > <paragraph>blabla</paragraph> > <paragraph>blabla</paragraph> > </very-rare> > <paragraph>blabla</paragraph> > </side-effects> > <overdosage/> > > This is from the DTD: > <!ELEMENT side-effects (paragraph | very-common | common | > less-common | rare | very-rare)* > > > This is what I want to create: > blabla > <table with the elements common, less-common and rare (and > their underlying paragraphs)> > blabla > blabla > <table with the elements common and very-rare (and their > underlying paragraphs)> > blabla > > So, I want to create tables, one table for each set of > elements that are not paragraphs. These sets are > separated by paragraphs and they contain paragraphs that > should be included in the table... Any > suggestions of how to do this? > > /Emma > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How to create tables from thi, Emma Larsson | Thread | Re: [xsl] How to create tables from, Jeni Tennison |
[xsl] passing parameter to an XSL s, Najmi, Jamal | Date | Re: [xsl] How to create tables from, Jeni Tennison |
Month |