Difference between revisions of "API:EPrints/XSLT"

From EPrints Documentation
Jump to: navigation, search
(Created page with '<!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' com…')
(No difference)

Revision as of 10:46, 25 August 2011

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::XSLT - utilities for XSLT processing

User Comments


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')" />
 

User Comments


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.

User Comments


METHODS

User Comments


new

$xslt = EPrints::XSLT->new( repository => $repo, ... )

Options:

 repository
 stylesheet
 dataobj
 dataobjs
 opts
 error_cb
 

User Comments


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.

User Comments


output_as_bytes

$bytes = $xslt->output_as_bytes( $result )

See XML::LibXSLT/output_as_bytes.

User Comments


EPT FUNCTIONS

User Comments


ept:citation( [ STYLE [, OPTIONS ] ] )

Returns the citation of style STYLE (or "default") for the current item.

User Comments


ept:config( KEY1 [, KEY2 [, ... ] ] )

Returns the repository configuration value.

User Comments


ept:documents()

Returns a list of the current item's documents (errors if current item is not an eprint).

User Comments


ept:icon( [ OPTIONS ] )

Returns a link to a document with icon.

Options:

 HoverPreview
 noHoverPreview
 NewWindow
 noNewWindow
 

User Comments


ept:one_of( NEEDLE [, HAYSTACK ] )

Returns true if NEEDLE is in HAYSTACK based on string equality.

User Comments


ept:param( KEY )

Returns the value of the parameter KEY e.g. in plugin arguments.

User Comments


ept:phrase( PHRASEID )

Returns the HTML phrase for PHRASEID.

User Comments


ept:render_value( FIELDID [, OPTIONS ] )

Returns the rendered value of FIELDID for the current item.

User Comments


ept:url( [ STAFF ] )

Returns the URL of the current item (or control page if STAFF is true).

User Comments


ept:value( FIELDID )

Returns the value of FIELDID for the current item.

User Comments


COPYRIGHT

User Comments