This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: How to create tables from this...?


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@ntlworld.com
work: Michael.Kay@softwareag.com

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
> Emma Larsson
> Sent: 23 April 2002 15:45
> To: xsl-list@lists.mulberrytech.com
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]