[xslt] [thimo debian org: Bug#204583: libxslt1: exslt-function not working in every context]



Hi,

The bug report below has been filed against the Debian package of libxslt.  Although
the bug report is against 1.0.30, I ran the provided sample code through 1.0.32 and
the problem still exists.  And I also used libxml2 2.5.10.

Is this indeed a bug and do I need to file it with bugzilla, or is this a not-yet
supported feature?

Thanks,
Ardo

----- Forwarded message from Thimo Neubauer <thimo@debian.org> -----

From: Thimo Neubauer <thimo@debian.org>
Subject: Bug#204583: libxslt1: exslt-function not working in every context
To: Debian Bug Tracking System <submit@bugs.debian.org>
Date: Fri, 08 Aug 2003 14:04:35 +0200
X-Mailer: reportbug 2.20

Package: libxslt1
Version: 1.0.30-3
Severity: normal


It's possible to define a function by using the EXSLT func:function
extension, however it does not work everywhere. 

  <func:function name="func:initial">
    <xsl:param name="s" />
    <func:result select="substring($s,1,1)" />
  </func:function>

defines a function and

  <xsl:value-of select="func:initial(.)"/>

works as expected. But if the function is used in the use-attribute of
a key

  <xsl:key name="Fails" match="test" use="func:initial(.)" />

xsltproc reports an error:

aylee /home/thimo> xsltproc bug.xsl bug.xml
xmlXPathCompOpEval: function initial not found
XPath error Unregistered function in func:initial(.)
Exitcode 10

Commenting out the xsl:key-statement shows that the error isn't
triggered by the value-of.

Xalan-J (libxalan2-java 2.5.0-1, libxerces2-java 2.4.0-1) processes
the stylesheet without errors. The attached example doesn't show that
this key works but I've got a larger stylesheet working with that
feature (or is this a Xalan-extension?)

Cheers
   Thimo

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux aylee 2.4.21dell #5 Die Jun 24 16:06:44 CEST 2003 i686
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro

Versions of packages libxslt1 depends on:
ii  libc6                         2.3.1-16   GNU C Library: Shared libraries an
ii  libxml2                       2.5.7-1    GNOME XML library
ii  zlib1g                        1:1.1.4-14 compression library - runtime

-- no debconf information


<?xml version="1.0" encoding='ISO-8859-1'?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:func="http://exslt.org/functions";
  extension-element-prefixes="func"
  >
  
  <func:function name="func:initial">
    <xsl:param name="s" />
    <func:result select="substring($s,1,1)" />
  </func:function>

  <xsl:template match="test">
    <out>
      <!-- function-call works as expected -->
      <xsl:value-of select="func:initial(.)"/>
    </out>
  </xsl:template>

  <!-- this key can be defined -->
  <xsl:key name="Works" match="test" use="substring(.,1,1)" />

  <!-- this key fails with xsltproc -->
  <xsl:key name="Fails" match="test" use="func:initial(.)" />

</xsl:stylesheet>
<?xml version="1.0" encoding="iso-8859-1"?>
<main>
  <test>foo</test>
</main>

----- End forwarded message -----

-- 
Ardo van Rangelrooij
home email: ardo@debian.org
home page:  http://people.debian.org/~ardo
GnuPG fp:   3B 1F 21 72 00 5C 3A 73  7F 72 DF D9 90 78 47 F9



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]