cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Edwards <>
Subject Problem with transform of aggregation
Date Thu, 26 Feb 2004 00:16:22 GMT
Hi Cocooners,
Sorry about the lengthy post but I'm flummoxed!
I have a somewhat perplexing issue in that I'm aggregating the output of 
3 XSPs that collectively return information about an asset's booking and 
date details.
If I save the XML generated from the aggregation and run it through the 
transform then the output is what I expect it to be, but if I try to run 
it in real time through the pipeline then no booking details are displayed.
The XSL line of interest is:

                <xsl:when test="$bookingList/event_desc = $evtDesc">
select="$bookingList[event_desc = $evtDesc]" mode="getBooking"/>

What this is trying to do is grab booking data that matches the name of 
the event eg: if we've got a booking for a room for Period 2 then the 
resulting table will show the name of the event (Period 2 in the first 
column) with the booking description in the second column of the table.
At the moment I'm not getting the match on the booking details. When run 
as a stand alone transform I get every event listed in column 1 and an 
entry in column 2 for those events that have a booking.

Why is the real time pipeline not working??

Thanks for any suggestions.


<!-- This is the complete XSL transform -->
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="" 
<xsl:output method="html" encoding="UTF-8"/>

    <xsl:param name="mode" />
    <xsl:param name="start" select="//calendar/start"/>
    <xsl:param name="count" select="//calendar/count"/>
    <xsl:param name="selectedDay" select="//calendar/selectedDay"/>
    <xsl:param name="monthName" select="//calendar/monthName"/>
    <xsl:param name="monthNumber" select="//calendar/monthNumber"/>
    <xsl:param name="year" select="//calendar/year"/>
    <xsl:param name="today" select="//calendar/today"/>
    <xsl:param name="currMonth" select="//calendar/currMonth"/>
    <xsl:param name="currYear" select="//calendar/currYear"/>
    <xsl:variable name="eventDescriptions" 
    <xsl:variable name="bookingList" 
    <xsl:template match="/">

    <head><title><xsl:value-of select="$today"/></title>

        <meta content="text/html;charset=UTF-8" http-equiv="content-type"/>
        <title>Booking Display by Day</title>

    <body bgcolor="#ffffff" border="1">
        <h1>Booking Display for <xsl:value-of select="$today"/></h1>
                <xsl:for-each select="$eventDescriptions">
                    <xsl:apply-templates select="."/>


<xsl:template match="event_desc">
    <xsl:variable name="evtDesc" select="normalize-space(.)"/>
        <td><xsl:value-of select="$evtDesc"/></td>
                <xsl:when test="$bookingList/event_desc = $evtDesc">
select="$bookingList[event_desc = $evtDesc]" mode="getBooking"/>

<xsl:template match="booking_details"/>

<xsl:template match="booking_details" mode="getBooking">
    <xsl:variable name="booker" select="name"/>
    <xsl:variable name="asset" select="asset_name"/>
    <xsl:variable name="bookDetail">
        <xsl:value-of select="concat('Booker: ',$booker,' | Asset: ', 
    <xsl:value-of select="$bookDetail"/><xsl:value-of select="event_desc"/>
    <!-- *********************
    <td><xsl:value-of select="event_desc"/></td>
    ********************* -->


<xsl:template match="text()"/>

<!--The aggregated xml looks like this: -->
<?xml version="1.0" encoding="ISO-8859-1"?>
                <event_desc>After School</event_desc>
                <name>Tim Edwards</name>
                <asset_name>Primary Reading</asset_name>
                <event_desc>After School</event_desc>
                <name>Anthony Edwards</name>
                <asset_name>Senior Computing</asset_name>
                <event_desc>Period 3</event_desc>
                <name>Tim Edwards</name>
                <event_desc>Period 4</event_desc>
                <name>Tim Edwards</name>
        <event_desc>Period 1</event_desc>
        <event_desc>Period 2</event_desc>
        <event_desc>Period 3</event_desc>
        <event_desc>Period 4</event_desc>
        <event_desc>Period 5</event_desc>
        <event_desc>Period 6</event_desc>
        <event_desc>After School</event_desc>


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message