Beyond XSL's capabilities?

Subject: Beyond XSL's capabilities?
From: "Blanchette, Larry" <Larry.Blanchette@xxxxxxxxxxxxx>
Date: Tue, 16 Mar 1999 13:55:20 -0600
I've been unable to reach a solution for the following example where I would

like to group a set of elements based on an attribute value, this would be 
driven by a different element's attribute value.  
My conclusion is you can't get there with xsl and the only recourse is to
rework the schema. Is this correct?  

<?xml version="1.0" ?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
<xsl:id element="beverage" attribute="bev.type"/>

<xsl:template match="drink.menu">
	<html><title>Drink Menu</title>
	<body><xsl:apply-templates select="menu"/></body>
	</html>
</xsl:template>

<xsl:template match="menu.group">
	<p><xsl:value-of select="@bev.type"/></p>
	<p>
<!-- how to generate the groups's list ?
	this doesn't work id's need to be unique
	<xsl:apply-templates select="id(@bev.type)"/>

	looked at the following but not valid:
	<xsl:apply-templates select=
	  "[/drink.menu/beverage.list/beverage@xxxxxxxx = @bev.type]"/>

	<xsl:for-each select="/drink.menu/beverage.list/beverage">
	  in the context of beverage here so i've lost menu.group@xxxxxxxx ?
-->
	</p>
</xsl:template>
</xsl:stylesheet>

Sample data:

<?xml version="1.0"?>

<drink.menu>
    <beverage.list>
        <beverage bev.type='Beer'>Sierra Nevada</beverage>
        <beverage bev.type='Beer'>Newcastle</beverage>
        <beverage bev.type='Vodka'>Screwdriver</beverage>
        <beverage bev.type='Vodka'>Greyhound</beverage>
    </beverage.list>
    <menu>
        <menu.group bev.type='Vodka'/>
        <menu.group bev.type='Beer' />
    </menu>
</drink.menu>

Thanks
Larry Blanchette


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread