Re: [xslt] Parsing bug? Or user not fully spec compliant?

On Thu, Nov 08, 2001 at 11:18:06AM -0800, Lars Kellogg-Stedman wrote:
> I'm following a fairly well trod path by trying to generate HTML from
> XML via xsltproc.  Unfortunately, I've run into a difference in
> behavior between xsltproc and 4xslt (the xslt processor from 4suite). 
> Given the following xml source:
>   <foo:document xmlns:foo='http://foo/'
>         xmlns=''>
>                 <h2>How much would would a wood chuck chuck?</h2>
>   <xsl:template match="h2">
>         <h2><xsl:value-of select="."/></h2>
>   </xsl:template>
> And this is what I get with 4xslt.  However, if I try to parse this
> with xsltproc, the verbose output says:
>   xsltProcessOneNode: no template found for h2
> In other words, the <h2> element is not matching the h2 template when
> the document is processed with xsltproc.  Is this a bug in the
> xsltproc?  Or is my stylesheet malformed?

  4xslt is bugged.
  h2 is in a namespace (

The "h2" XPath expression will only match element of name h2 which have
no namespace.
Section 2.3
A node test that is a QName is true if and only if the type of the node
(see [5 Data Model]) is the principal node type and has an expanded-name
equal to the expanded-name specified by the QName.
 The expanded name of the element in the document is
 the one for the match is

 Fix that by defining a prefix in your stylesheet associated to and add the prefix to the match.

  And don't forget to report the bug to 4suite,


Daniel Veillard      | Red Hat Network  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

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