On Wed, Sep 06, 2000 at 03:39:48PM +0200, Kaiserovi wrote:
> > I am trying to use the function normalize-space on a string and
> > allways get an error message:
> > 
> > ...
> >     <xsl:variable name='s'>
> >         <xsl:value-of select='normalize-space(string($datestring))'/>
> >     </xsl:variable>
> > ...
> > 
> > gives the message:
> > 
> > sabcmd: datastr.cpp:290: void Str::nset(const char *, int): Assertion
> > `chars' failed.
> > Abort
> Guenter,
> 
> I can't help it, this seems to work in all cases I've tried. Send the
> test data please.
> 
> As for the line number: you can't get it, because this is sort of
> internal error, not a processing error like, say, a misspelled name. So
> the only information one gets is where inside Sablotron the error
> occured.
> 
> Tom Kaiser

I had a hard time reproducing it, too now - the problem seems to be with
empty strings.  I did (less may do also):

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

<xsl:output method="xml" indent="yes" encoding="iso-8859-1" 
    doctype-system="DLmeta.dtd"/>

<xsl:template match='data'>
    <xsl:call-template name='another'>
        <xsl:with-param name='datestring'
select='something[@name="date"]'/>
    </xsl:call-template>
    <xsl:call-template name='another'>
        <xsl:with-param name='datestring' select='something[@name="none"]'/>
    </xsl:call-template>
</xsl:template>

<xsl:template name='another'>
    <xsl:param name='datestring'/>
    <xsl:variable name='s' select='normalize-space(string($datestring))'/>
    <xsl:value-of select='$s'/>
</xsl:template>

</xsl:stylesheet>


with the XML file

<data>
   <something name='date'>March 23, 1993</something>
</data>


and it crashes.  Removing the call to normalize-space or the second
call-template removes the problem from the above code.  I still believe
this is a bug.

-- 
Guenter Radestock, Universitaetsbibliothek Karlsruhe
[EMAIL PROTECTED]
http://www.ubka.uni-karlsruhe.de/~guenter

Reply via email to