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

Beyond XSL's capabilities?

Subject: Beyond XSL's capabilities?
From: "Blanchette, Larry" <Larry.Blanchette@xxxxxxxxxxxxx>
Date: Tue, 16 Mar 1999 13:55:20 -0600
xsl capabilities
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

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.