Koha-clms/Koha
David Cook d3c128af9d Bug 13262 - Add parameters to XSLT Handler transform method
This patch adds an optional hashref argument to the XSLT_Handler
transform() method. It allows you to send key => value pairs
parameters to the XML::LibXSLT object, which you can reference
in a XSLT via <xsl:param name="XXX" />.

The parameter value is evaluated as an XPath query, so you can only
pass quoted strings (i.e. "'test'") or numbers. Otherwise, the
XSLT engine will interpret it as a Xpath query and will run it
on the XML that you're transforming.

The most common use case is sending strings to a XSLT. In my case,
this is an OAI-PMH identifier that comes in a OAI response but not
the actual metadata. See the following link from the official POD:
http://search.cpan.org/~shlomif/XML-LibXSLT-1.92/LibXSLT.pm#Parameters

_TEST PLAN_

1) Run "perl t/db_dependent/XSLT_Handler.t". If all tests pass,
you should be free to sign off. Feel free to inspect the last
test in XSLT_Handler.t and the XSL in test04.xsl to see how it
works.

If you really want to be thorough, you could write your own test
cases using mine as an example.

Alternatively, you could go into C4::XSLT, and try to pass a
value to a parameter in the search results or the detail page,
but that might be a bit over the top.

It's a pretty simple patch.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-02-05 15:24:29 -03:00
..
Acquisition Bug 12896: Move the bookseller-related code into Koha::Acquisition::Bookseller 2014-12-31 14:15:58 -03:00
Borrower Bug 12784: Patron cannot change his personal details 2014-08-21 09:36:19 -03:00
Cache Bug 12041 - improve Koha::Cache 2014-06-19 13:05:04 -03:00
Filter/MARC Bug 9620: IncludeSeeFromInSearches and data in $9 subfields can break indexing 2013-03-07 09:31:11 -05:00
Indexer Bug 10143 - Fixing license headers 2013-05-01 06:47:50 -04:00
Item/Search Bug 11425: Add unit tests 2014-11-04 19:10:28 -03:00
List Bug 15065: (follow-up) update license header 2013-10-14 21:50:10 +00:00
Misc Bug 3050 - Add an option to upload scanned invoices #1/3 2014-05-25 21:14:00 +00:00
Number Bug 12969: Add a subroutine to calculate VAT and prices 2015-01-04 12:45:18 -03:00
Plugins Bug 9971 - Plugins system is broken! 2013-04-03 06:02:09 -04:00
QueryParser/Driver Bug 12647: PQF QueryParser driver and unit tests fixes 2014-08-11 10:09:38 -03:00
RecordProcessor Bug 7417: Include see from references in bibliographic searches 2012-09-13 14:19:28 +02:00
Schema/Result Bug 12601: (RM followup) DBIx updates 2015-02-05 15:21:51 -03:00
SuggestionEngine Bug 11944: Fix encoding issue for the "Did you mean" feature 2015-01-13 13:07:26 -03:00
Template/Plugin Bug 11944: TT Plugins should not encode strings 2015-01-13 13:07:07 -03:00
Util Bug 13223: [QA Follow-up] Trivial change to one POD line 2014-11-19 13:28:23 -03:00
AuthUtils.pm Bug 11944: Authentication 2015-01-13 13:07:14 -03:00
Authority.pm Bug 5202: QA follow-up - correct license and POD errors 2013-10-10 21:39:15 +00:00
Cache.pm Bug 12041: UT - Get rid of warnings 2014-06-19 13:05:22 -03:00
Calendar.pm Bug 11634 [QA Followup] - Make unit tests pass 2014-11-12 14:56:41 -03:00
Database.pm Bug 11891: (follow-up) set DBIC storage flags correctly 2014-06-19 11:55:23 -03:00
DateUtils.pm Bug 13242: Remove warning if no parameter given 2014-11-26 11:17:08 -03:00
Email.pm Bug 9530: Adding a new Koha::Email module 2014-10-27 10:38:14 -03:00
I18N.pm Bug 11848: (follow-up) update license statment 2014-05-05 04:51:42 +00:00
Linktracker.pm Bug 8917 : [ Sign followup ] Track clicks to links external to Koha 2013-03-07 11:14:25 -05:00
MetadataRecord.pm Bug 9755 QA follow-up: move MARC-specific functionality to utility class 2013-07-23 23:10:21 +00:00
NorwegianPatronDB.pm Bug 11401: QA followup - Make the tests pass 2014-11-14 09:42:56 -03:00
Plugins.pm Bug 9907 - Plugins test dies early on some servers 2013-03-22 17:50:09 -04:00
RecordProcessor.pm Bug 7417: Include see from references in bibliographic searches 2012-09-13 14:19:28 +02:00
Schema.pm Bug 11891: (follow-up) remove custom storage class 2014-06-19 11:55:03 -03:00
SimpleMARC.pm Bug 11413: Fix field_numbers 2014-11-14 12:05:47 -03:00
SuggestionEngine.pm Bug 8726: ExplodedTerms suggestion plugin (functionality) 2012-09-28 17:08:21 +02:00
XSLT_Handler.pm Bug 13262 - Add parameters to XSLT Handler transform method 2015-02-05 15:24:29 -03:00