ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

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

Re: conditional copying of nodes?

Subject: Re: conditional copying of nodes?
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Wed, 22 Aug 2001 11:08:08 +0200
Re:  conditional copying of nodes?
"Hewko, Doug" <Doug.Hewko@xxxxxxxxxxxxxxx> wrote

> I've got the copy working but how I can incorporate this into my sort? I am
> trying to copy the existing <member> tree to <newmember> for the sorting.

I'm not sure why you want to copy the member data. Actually,
i'm not sure why you want grouping.
I guess you want to have a list of all distinct groups, and a list
of the members within the groups.
Try the following:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" encoding="ISO-8859-1"/>
  <xsl:strip-space elements="*"/>
  <xsl:key name="contacts-by-group" match="member" use="group" />
  
  <xsl:template match="teammembers">
    <html><head><title>Contacts by group</title></head>
      <body>
        <!-- iterate over distinct groups -->
        <xsl:for-each select="member/group[not(preceding::group=.)]">
          <xsl:sort select="."/>
          <h1>Group <xsl:value-of select="."/></h1>
          <!-- process all members of the current group -->
          <xsl:apply-templates select="key('contacts-by-group',.)">
            <xsl:sort select="name"/>
          </xsl:apply-templates>
        </xsl:for-each>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="member">
    <h2><xsl:value-of select="name"/></h2>
    <p>Email: <xsl:value-of select="e_mail"/></p>
    <p>Phone: <xsl:value-of select="phone"/></p>
  </xsl:template>
  
</xsl:stylesheet>


HTH
J.Pietschmann

 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.