This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: grouping content
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] grouping content
- From: "Tim Watts" <timw at 3d3 dot com>
- Date: Fri, 6 Apr 2001 10:00:05 +1000
- Cc: <gavinm at yatra dot net>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Obviously the test is failing.
Try
<xsl:choose>
<xsl:when test="Location/@Area=$Location">
</xsl:when>
<xsl:otherwise>
<br/>Location <xsl:value-of select="$Location"/>
</xsl:otherwise>
</xsl:choose>
<br/><xs:value-of select="@Value"/>
The X-path is looking for an *attribite* called Location.
I also removed the
<xsl:param name="Location" select="@Location"/>
as it cannot be there.
It isn't needed anyway as it seems the variable $Location has been defined
within the template you are using.
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Gavin Myers
Sent: Friday, 6 April 2001 6:56 AM
To: 'XSL-List@lists.mulberrytech.com'
Subject: [xsl] grouping content
hello
having a slight problem
lets say the xml looks like this:
<Location Area="A" Value="23">
<Location Area="A" Value="24">
<Location Area="B" Value="45">
and I want to pull out values like this:
Location A
23
24
Location B
45
In xsl I was thinking of doing this:
<xsl:choose>
<xsl:when test="@Location=$Location">
</xsl:when>
<xsl:otherwise>
<xsl:param name="Location" select="@Location"/>
<br/>Location <xsl:value-of select="$Location"/>
</xsl:otherwise>
</xsl:choose>
<br/><xs:value-of select="@Value"/>
For some reason it will go straight to the otherwise and not even look at
the test.
Does anyone know of a good way to resolve this?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list