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?
"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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








