Report DBXsl

General Discussion
Post Reply
User avatar
DougWilliams
Site Admin
Posts: 374
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Report DBXsl

Post by DougWilliams » Thu May 28, 2020 12:27 am

There was a request via the FaceBook group about only showing the Reissue Date in CATraxx when it doesn't match the Original Release Date in a report. It was suggested that a DBXsl could be used. Well I had never done a DBXsl before so I challenged myself...with success!
The second date will only display when it doesn't equal the first date.
The code could probably be cleaner but I'm happy with the results.
Annotation 2020-05-27 192240.jpg
Annotation 2020-05-27 192240.jpg (6.68 KiB) Viewed 93 times
Annotation 2020-05-27 192241.jpg
Annotation 2020-05-27 192241.jpg (95.89 KiB) Viewed 93 times
Annotation 2020-05-27 192239.jpg
Annotation 2020-05-27 192239.jpg (16.74 KiB) Viewed 93 times

Code: Select all

<!-- Album: Reissue Date -->
<?xml version="1.0" encoding="utf-8"?>
<?data type="record"?>
<?data table="album"?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:include href="Common.xsl"/>

<xsl:template match="/">
  <html>
  <body>
    <xsl:apply-templates select="data/record/albumdata"/>
  </body>  
  </html>
</xsl:template>

<xsl:template match="albumdata">  
  <xsl:if test="reissuedate/@year!=released/@year">
      <xsl:value-of select="reissuedate/@year"/>
  </xsl:if>
</xsl:template>

</xsl:stylesheet>  
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

Post Reply