[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: RE: How to create tables from this...?
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 23 Apr 2002 17:15:37 +0100
emma xsl
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.