EPrints Technical Mailing List Archive

Message: #05865


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] XSLT export: list/eprint vs dataobj/eprint output


I’m looking at the API:EPrints/Plugin/Export/XSLT documentation.

 

The sample Title.xsl transform specifies a template match for ept:template prefixed by a /:

<xsl:template match="/ept:template">

<titles><xsl:value-of select="$results"/></titles>

</xsl:template>

 

The samples in the Headers and Footers subsection exclude the /:

  <xsl:template match="ept:template">
    <html>
      <body>
        <xsl:value-of select="$results"/>
      </body>
    </html>
  </xsl:template>

 

I’m running the export from the command line, with either a single eprint, or a list of eprints:

sudo su eprints -s /bin/bash -c '/opt/eprints3/bin/export pittir eprint XSLT::Title 29112 29152'

sudo su eprints -s /bin/bash -c '/opt/eprints3/bin/export pittir eprint XSLT::Title 29112'

 

I expect the stylesheet to include or exclude the parent wrapper <titles> based on whether it is a dataobj (single) or list (multiple) context.

 

Instead, the parent wrapper <titles> seems entirely dependent on whether the ept:template match is preceded by the /.

 

Per the Pod/Wiki, no <titles>:

$ sudo su eprints -s /bin/bash -c '/opt/eprints3/bin/export pittir eprint XSLT::Title 29112 29152'

<?xml version='1.0' encoding='UTF-8'?>

<title>COMPARISON OF MINDFUL AND SLOW EATING STRATEGIES ON ACUTE&#13;ENERGY INTAKE</title>

<title>Objectively Measured Physical Activity and Sedentary Behavior in Children with Autism Spectrum Disorder</title>

$ sudo su eprints -s /bin/bash -c '/opt/eprints3/bin/export pittir eprint XSLT::Title 29112'

<?xml version='1.0' encoding='UTF-8'?>

<title>COMPARISON OF MINDFUL AND SLOW EATING STRATEGIES ON ACUTE&#13;ENERGY INTAKE</title>

 

After removing the root slash from ept:template, always <titles>:

$ sudo su eprints -s /bin/bash -c '/opt/eprints3/bin/export pittir eprint XSLT::Title 29112 29152'

<?xml version='1.0' encoding='UTF-8'?>

<titles><title>COMPARISON OF MINDFUL AND SLOW EATING STRATEGIES ON ACUTE&#13;ENERGY INTAKE</title>

<title>Objectively Measured Physical Activity and Sedentary Behavior in Children with Autism Spectrum Disorder</title>

</titles>

$ sudo su eprints -s /bin/bash -c '/opt/eprints3/bin/export pittir eprint XSLT::Title 29112'

<?xml version='1.0' encoding='UTF-8'?>

<titles><title>COMPARISON OF MINDFUL AND SLOW EATING STRATEGIES ON ACUTE&#13;ENERGY INTAKE</title>

</titles>

 

Is this intentional?

 

Enjoy,

 

- Clinton Graham

Systems Developer

University of Pittsburgh | University Library System

412-383-1057