Re: [xslt] Typo in transform.c??

On Wed, 22 Sep 2004 07:52:47 -0400, Daniel Veillard <veillard redhat com> wrote:
> On Wed, Sep 22, 2004 at 12:40:55PM +0100, Stuart Dootson wrote:
> > Hi - I'm using libxslt 1.1.10 in an application & setting my own error
> > handler via xsltSetGenericErrorFunc. I'm finding, however, that if
> > errors occur when I call xsltApplyStylesheetUser, the context is set
> > to NULL. This appears to be because calls to xsltGenericError in
> > transform.c are using xsltGenericDebugContext as the context parameter
> > rather than xsltGenericErrorContext (which is used everywhere else in
> > libxslt). Is this a bug?
>   Sounds so, I just checked it, yes this looks buggy, I fixed it and
> will commit this later.
> > On a related note - I provoked a compilation error during a call to
> > xsltParseStylesheetDoc by changing the <xsl:stylesheet> element to
> > <xsl:stalesheet> - I'm testing my error handling, as I'm not using a
> > fixed set of stylesheets. This caused a message to be generated with
> > the words 'compilation error' in. However, this was indicated as a
> > warning rather than an error in the returned stylesheet structure
> > (i.e. the warnings member was incremented rather than the error
> > member). Is this by design? If so, what mechanism is there for
> > detected compilation errors? Or should I treat the warning count as if
> > it were an error count?
>   I would need to duplicate this to double check precisely.
> The fact that syntactic checking are not complete is a known bug
> Daniel
> --
> Daniel Veillard      | Red Hat Desktop team
> veillard redhat com  | libxml GNOME XML XSLT toolkit
> | Rpmfind RPM search engine

A sample stylesheet is attached at the bottom. The process I followed was:

xmlDocPtr stylesheetDoc = xmlParseFile(filename);
xsltStylesheetPtr stylesheet = xsltParseStylesheetDoc(stylesheetDoc);

Two errors are raised during xsltParseStylesheetDoc:

  compilation error: file very-simple.xslt element stalesheet.
  xsltStylePreCompute: unknown xsl:stalesheet

Basically, xsltStylePreCompute is whinging about not knowing what a
'stalesheet' is. Now - the point is - if xsltStylePreCompute doesn't
recognise an XSLT element (i.e. one in the
'' namespace), is that an error or

---------- sample.xsl ----------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stalesheet version="1.0" 

   <xsl:output method="xml" indent="yes"/>

   <xsl:template match="/">
         <xsl:apply-templates select="//swn:ChangeHistory"/>

   <xsl:template match="swn:ChangeHistory">
      <ChangeHistory author="{./swn:Author}" date="{./swn:Date}"
         <xsl:value-of select="swn:Comment/text()"/>


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