After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623855 - Missing AVT handling for xsl:attribute/@grouping-size
Missing AVT handling for xsl:attribute/@grouping-size
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
1.1.26
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-08 16:44 UTC by Phil Shafer
Modified: 2021-07-05 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Phil Shafer 2010-07-08 16:44:19 UTC
The grouping-size attribute of xsl:number is an attribute value template but is missing the proper expansion.  The spec says:

    The xsl:number element is used to insert a formatted number
    into the result tree. The number to be inserted may be specified
    by an expression. The value attribute contains an expression.
    The expression is evaluated and the resulting object is converted
    to a number as if by a call to the number function. The number
    is rounded to an integer and then converted to a string using
    the attributes specified in [7.7.1 Number to String Conversion
    Attributes]; in this context, the value of each of these
    attributes is interpreted as an attribute value template.

But this XSLT:

      <!-- Show the oldest five deceased authors -->
      <xsl:for-each select="$authors/author[life-span/born and life-span/died]">
        <xsl:sort select="life-span/died - life-span/born" order="descending"/>
        <xsl:variable name="gsize" select="1"/>
        <xsl:if test="position() &lt;= 5">
          <xsl:element name="oldest">
            <xsl:attribute name="gsize">
              <xsl:value-of select="$gsize"/>
            </xsl:attribute>
            <xsl:attribute name="age">
              <xsl:number value="life-span/died - life-span/born" grouping-size="1" group
ing-separator="."/>
            </xsl:attribute>
            <xsl:attribute name="age2">
              <xsl:number value="life-span/died - life-span/born" grouping-size="{$gsize}
" grouping-separator="."/>
            </xsl:attribute>
            <xsl:attribute name="born">
              <xsl:value-of select="life-span/born"/>
            </xsl:attribute>
            <xsl:attribute name="died">
              <xsl:value-of select="life-span/died"/>
            </xsl:attribute>
            <xsl:attribute name="name">
              <xsl:value-of select="concat(name/first, &quot; &quot;, name/last)"/>
            </xsl:attribute>
          </xsl:element>
        </xsl:if>
      </xsl:for-each>

produces this output:

  <oldest gsize="1" age="8.9" age2="89" born="1886" died="1975" name="Rex Stout"/>
  <oldest gsize="1" age="8.8" age2="88" born="1906" died="1994" name="Michael Innes"/>
  <oldest gsize="1" age="8.7" age2="87" born="1895" died="1982" name="Ngaio Marsh"/>
  <oldest gsize="1" age="8.6" age2="86" born="1907" died="1993" name="Leslie Charteris"/>
  <oldest gsize="1" age="8.6" age2="86" born="1890" died="1976" name="Agatha Christie"/>

for a list of authors that looks like:

    <author>
      <name>
        <first>Agatha</first>
        <last>Christie</last>
      </name>
      <life-span>
        <born>1890</born>
        <died>1976</died>
      </life-span>
    </author>

The "age" attribute comes out as expected, but "age2" uses "{$gsize}"
which seems to have no affect at all.
Comment 1 Phil Shafer 2010-07-08 16:47:56 UTC
Looks like libxslt/preproc.c:xsltNumberComp() is missing AVT handling for all the attributes of xsl:number.  Calls to xsltEvalStaticAttrValueTemplate() are needed.
Comment 2 GNOME Infrastructure Team 2021-07-05 11:01:14 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxslt/-/issues/

Thank you for your understanding and your help.