Hi, On Tue, Dec 16, 2008 at 5:27 PM, Michael Hafen <mdha...@tech.washk12.org> wrote: > Also it looks to me like the OPAC xslt will only show item availability > for the first branch that has an item. Maybe I'm understanding the xslt > wrong, but looking at a search result in the OPAC it seems this is true. > > I'm looking at this bit in the OPAC stylesheet for MARC21: > <xsl:variable name="available_items" > select="key('item-by-status', 'available')"/> > <xsl:for-each > select="$available_items[generate-id() = > generate-id(key('item-by-status-and-branch', concat(items:status, ' ', > items:homebranch))[1])]"> > : I don't see how that will grab more that just the first homebranch.
That clause really does scan all of the available items and counts the number of available items for each home branch. It uses the Muenchian method to do the grouping; see http://www.jenitennison.com/xslt/grouping/muenchian.html for an explanation of the general technique. In this case, the XSLT is: [1] Putting a list of all available item nodes into the $available_items variable by doing a lookup on the item-by-status key, which is defined in line 10 of the stylesheet: <xsl:key name="item-by-status" match="items:item" use="items:status"/> [2] Selecting each node in $available_items that is the first available item for each homebranch; this uses the item-by-status-and-branch key. [3] Emitting the homebranch and a count of available items in that homebranch, again using the item-by-status-and-branhc key. > I would very much welcome any suggestions on getting item call numbers > into the xslt. I'd also welcome comments on the item availability > thing. You can get the item call numbers in one of two ways: [1] Update the XSLT to grab it from the 952$o, assuming you're using the default MARC21 frameworks. [2] Change C4::XSLT::buildKohaItemsNamespace() to include itemcallnumber in the item XML, then adjust the XSL to use it. Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charl...@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel