API:EPrints/XSLT
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
- 1 NAME
- 2 SYNOPSIS
- 3 DESCRIPTION
- 4 METHODS
- 5 EPT FUNCTIONS
- 5.1 ept:citation( [ STYLE [, OPTIONS ] ] )
- 5.2 ept:config( KEY1 [, KEY2 [, ... ] ] )
- 5.3 ept:documents()
- 5.4 ept:icon( [ OPTIONS ] )
- 5.5 ept:one_of( NEEDLE [, HAYSTACK ] )
- 5.6 ept:param( KEY )
- 5.7 ept:phrase( PHRASEID )
- 5.8 ept:render_value( FIELDID [, OPTIONS ] )
- 5.9 ept:url( [ STAFF ] )
- 5.10 ept:value( FIELDID )
- 6 COPYRIGHT
NAME
EPrints::XSLT - utilities for XSLT processing
SYNOPSIS
my $xslt = EPrints::XSLT->new( repository => $repository, stylesheet => $stylesheet, ); my $result = $xslt->transform( $doc ); print $xslt->output_as_bytes( $result );
Using ept functions:
<xsl:value-of select="ept:value('title')" /> <xsl:copy-of select="ept:render_value('title')" />
DESCRIPTION
Because XSLT requires very careful treatment this module should probably be only used by internal code.
For the correct context to be set for 'ept:' functions this module must be used for every transform.
METHODS
new
$xslt = EPrints::XSLT->new( repository => $repo, ... )
Options:
repository stylesheet dataobj dataobjs opts error_cb
transform
$result = $xslt->transform( $doc [, @parameters ] )
Transforms $doc with the given stylesheet. @parameters is an optional list of key-value pairs to pass to the stylesheet.
output_as_bytes
$bytes = $xslt->output_as_bytes( $result )
See XML::LibXSLT/output_as_bytes.
EPT FUNCTIONS
ept:citation( [ STYLE [, OPTIONS ] ] )
Returns the citation of style STYLE (or "default") for the current item.
ept:config( KEY1 [, KEY2 [, ... ] ] )
Returns the repository configuration value.
ept:documents()
Returns a list of the current item's documents (errors if current item is not an eprint).
ept:icon( [ OPTIONS ] )
Returns a link to a document with icon.
Options:
HoverPreview noHoverPreview NewWindow noNewWindow
ept:one_of( NEEDLE [, HAYSTACK ] )
Returns true if NEEDLE is in HAYSTACK based on string equality.
ept:param( KEY )
Returns the value of the parameter KEY e.g. in plugin arguments.
ept:phrase( PHRASEID )
Returns the HTML phrase for PHRASEID.
ept:render_value( FIELDID [, OPTIONS ] )
Returns the rendered value of FIELDID for the current item.
ept:url( [ STAFF ] )
Returns the URL of the current item (or control page if STAFF is true).
ept:value( FIELDID )
Returns the value of FIELDID for the current item.
COPYRIGHT