Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am using an existing Umbraco 4.5.2 installation and have a really weird problem.
I have a list of bulletins and bulletinCategories and some of them are in categories and some are not. I want to show the bulletins not in categories and the bulletin categories.
I have them in an alphabetical list and I am using xsl Keys to display the A,B,C etc at the top of each section and to split them out.
For some reason it's not showing the Ps!!
This is my XSLT:
<xsl:key name="bulletin-by-letter" match="*" use="concat(substring(@nodeName,1,1) ,sitecategory)"/>
<xsl:variable name="bulletins" select="$currentPage/ancestor-or-self::root//*[(not(parent::BulletinCategory) and
(self::BulletinCategory or self::Bulletin)
and category = $selectedCat)]" />
<xsl:sort select="@nodeName" data-type="text" />
<xsl:if test="count(. | key('bulletin-by-letter', concat(substring(@nodeName, 1, 1),sitecategory))) = 1">
<h2 style="margin-top:15px;"><xsl:value-of select="concat(substring(@nodeName, 1, 1),sitecategory)" /></h2> <-- this bit shows A or B or C etc
<xsl:apply-templates select="key('bulletin-by-letter', concat(substring(@nodeName, 1, 1),sitecategory))" mode="item">
$Bulletins definitely contains the nodes beginning with P.
If I just do the
<xsl:value-of select="concat(substring(@nodeName, 1, 1),sitecategory)"/>
it shows PCategoryName.
but if I check it against the key like so:
<xsl:if test="count(. | key('disease-by-letter', concat(substring(@nodeName, 1, 1),sitecategory))) = 1">
It comes back as false.
Also if I change all my node name to start with a lower case p. It works fine.. or any other letter for that matter!
It just seems to have a problem with P's!!
I have no clue what is going on, and don't really understand XSLT enough to get any further!
Can anyone help??
Is there something weird about the key that doesn't like certain letters?
In case this helps any one in the future the problem was with my key.
The key was set to match * so although my bulletins variable was filtering bulletins that didn't have a parent of "BulletinCategory" the key was matching everything so when it was checking if the match = 1 it was equalling 2.
The reason this caused a problem with my P's was because some of my bulletinCategories had sub bulletins called things such as Part 1, Part 2 etc...
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted