Ok this is pretty lame for a problem report but I have to start somewhere.

I am testing my stylesheet in kernow before integrating into a bash shell script.

When I run the stylesheet from kernow I get this output

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
   <critic name="glenn abel" agreement="90">
      <affiliations>
         <publications>Hollywood Reporter</publications>
      </affiliations>
      <totals reviews="23" quickRatings="2"/>
   </critic>
   <page link="" reviewsPerPage=""/>
</metadata>

Running the same stylesheet from the command line I get the following

<metadata>
   <page link="" reviewsPerPage=""/>
   <page link="" reviewsPerPage=""/>
</metadata>

Now I have confirmed (by the insertion of traceable text) that the same stylesheet is being executed in both cases.

This is my command line invocation.

#!/bin/sh
java -jar $HOME/saxon9he.jar -s:glennabel.xhtml -xsl:getPageCounts.xsl

I have also tried

#!/bin/sh
cat glennabel.xhtml | java -jar $HOME/saxon9he.jar -s:-  -xsl:getPageCounts.xsl

If I substitute a different stylesheet that runs against the same input and is stored in the same directory I get the right results - that suggests the invocation is ok. Now you'll say it must be the stylesheet but the stylesheet gives the right results when run from kernow.