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

RE: Aggregation

Subject: RE: Aggregation
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Fri, 7 Sep 2001 23:32:34 +0100
xsl aggregation
Garry,
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">	
  <html>
    <body>
      <table>
 
<tr><td>State</td><td>Type1</td><td>Type2</td><td>Type3</td></tr>
          <xsl:apply-templates select="eas/ea[st != preceding::st] |
eas/ea[1]" />
      </table>
    </body>
  </html>
</xsl:template>
<xsl:template match="ea">
  <tr>
    <td><xsl:value-of select="position()" /></td>
    <td><xsl:if test="contains(../ea[st = current()/st]/type1,
'Y')">X</xsl:if></td>
    <td><xsl:if test="contains(../ea[st = current()/st]/type2,
'Y')">X</xsl:if></td>
    <td><xsl:if test="contains(../ea[st = current()/st]/type3,
'Y')">X</xsl:if></td>
  </tr>
</xsl:template>
</xsl:stylesheet>

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Mulberry Technologies List Owner
> Sent: 07 September 2001 22:10
> To: xsl-list
> Subject:  Aggregation
> 
> 
> 
> >From: "Frenkel, Garry J." <garry.j.frenkel@xxxxxxx>
> >To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" 
> ><xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> >Subject: Help with aggregation
> >Date: Fri, 7 Sep 2001 15:58:26 -0400
> >
> >Assuming the following xml fragment:
> ><eas>
> ><ea>
> ><st>1</st>
> ><type1>Y</type1>
> ><type2>N</type2>
> ><type3>Y</type3>
> ></ea>
> ><ea>
> ><st>1</st>
> ><type1>Y</type1>
> ><type2>N</type2>
> ><type3>N</type3>
> ></ea><ea>
> ><st>2</st>
> ><type1>Y</type1>
> ><type2>N</type2>
> ><type3>N</type3>
> ></ea>
> >etc.
> ></eas>
> >
> >The result needs to be an HTML Table like:
> >
> >State	Type1	Type2	Type3
> >1	  X           X
> >2       X
> >
> >In other words for every state designate if it supports any type as 
> >denoted by the Y in the typex element.
> >
> >I've been fooling around with this for a couple of days and 
> am about to 
> >give up and use the DOM programatically.  I'd appreciate any help.
> 
> 
> -- 
> ======================================================================
> B. Tommie Usdin                        mailto:btusdin@xxxxxxxxxxxxxxxx
> Mulberry Technologies, Inc.                
> http://www.mulberrytech.com  
> 17 West Jefferson Street        
>                    Phone: 301/315-9631
> Suite 207                                    Direct Line: 301/315-9634
> Rockville, MD  20850                                 Fax: 301/315-8285
> ----------------------------------------------------------------------
>   Mulberry Technologies: A Consultancy Specializing in SGML 
> and XML              
> ======================================================================
> 
>  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.