David Cook
d3c128af9d
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> |
||
---|---|---|
.. | ||
Acquisition | ||
Biblio | ||
Budgets | ||
Circulation | ||
DataTables | ||
db_dependent | ||
Koha/Plugin | ||
lib | ||
Members | ||
Number | ||
Search | ||
Serials | ||
00-checkdatabase-version.t | ||
00-deprecated.t | ||
00-load.t | ||
00-merge-conflict-markers.t | ||
00-testcritic.t | ||
00-valid-xml.t | ||
Auth_with_shibboleth.t | ||
AuthoritiesMarc_MARC21.t | ||
AuthoritiesMarc_UNIMARC.t | ||
AuthUtils.t | ||
Barcodes_annual.t | ||
Barcodes_EAN13.t | ||
Barcodes_hbyymmincr.t | ||
Barcodes_incremental.t | ||
Barcodes_ValueBuilder.t | ||
Biblio.t | ||
Bookseller.t | ||
Boolean.t | ||
Branch.t | ||
Breeding.t | ||
Budgets.t | ||
Cache.t | ||
Calendar.t | ||
Charset.t | ||
Circulation_barcodedecode.t | ||
ClassSortRoutine.t | ||
ClassSortRoutine_Dewey.t | ||
ClassSortRoutine_Generic.t | ||
ClassSortRoutine_LCC.t | ||
ClassSource.t | ||
Context.t | ||
Contract.t | ||
Creators.t | ||
Dates.t | ||
DateUtils.t | ||
Debug.t | ||
dummy.t | ||
External_Overdrive.t | ||
External_Syndetics.t | ||
Form_MessagingPreferences.t | ||
Heading.t | ||
Images.t | ||
ImportBatch.t | ||
Input.t | ||
Installer_PerlDependencies.t | ||
Installer_PerlModules.t | ||
Installer_pm.t | ||
ItemCirculationAlertPreference.t | ||
ItemType.t | ||
Koha.t | ||
Koha_Email.t | ||
Koha_MetadataRecord.t | ||
Koha_Template_Plugin_Cache.t | ||
Koha_Template_Plugin_Koha.t | ||
Koha_Util_FrameworkPlugin.t | ||
Koha_Util_MARC.t | ||
Labels.t | ||
Labels_split_ccn.t | ||
Labels_split_ddcn.t | ||
Labels_split_lccn.t | ||
Languages.t | ||
Letters.t | ||
Log.t | ||
Matcher.t | ||
Members_Attributes.t | ||
Members_AttributeTypes.t | ||
Members_Messaging.t | ||
Message.t | ||
NorwegianPatronDB.t | ||
Output.t | ||
Output_JSONStream.t | ||
Overdues.t | ||
Patroncards.t | ||
Patroncards_Batch.t | ||
Patroncards_Layout.t | ||
Patroncards_Lib.t | ||
Patroncards_Patroncard.t | ||
Patroncards_Profile.t | ||
Patroncards_Template.t | ||
perlcriticrc | ||
Prices.t | ||
Print.t | ||
QueryParser.t | ||
RecordProcessor.t | ||
Review.t | ||
Ris.t | ||
RotatingCollections.t | ||
Scheduler.t | ||
Scrubber.t | ||
Search.t | ||
Search_PazPar2.t | ||
SimpleMARC.t | ||
SIP_Sip.t | ||
smolder_smoke_signal | ||
SMS.t | ||
SocialData.t | ||
Stats.t | ||
SuggestionEngine.t | ||
SuggestionEngine_AuthorityFile.t | ||
TmplToken.t | ||
XSLT.t |