Re: [xslt] xsltproc error 'xsltApplyOneTemplate: attribute-set was not compiled'



sudhakar+xslt CS Princeton EDU said:
>
>
> Hi all
>
> 	I am getting this error:
>
> xsltApplyOneTemplate: attribute-set was not compiled
>
> for a simple syle sheet.  Can some one tell me what to do?
>
>
> [20:21:26]opus::~ $ xsltproc --version
> Using libxml 20510, libxslt 10033 and libexslt 722
> xsltproc was compiled against libxml 20510, libxslt 10033 and libexslt 722
> libxslt 10033 was compiled against libxml 20510
> libexslt 722 was compiled against libxml 20510

First advice - update your software (current libxml2 is 2.6.16, and current
libxslt is 1.1.12).  Note that this advice has nothing to do with the problem.
Your xsl/xml will fail in more or less the same way with the current version
:-).

> [20:21:32]opus::~ $ uname -a
> Linux opus 2.4.21-15.0.4.ELsmp #1 SMP Sat Jul 31 01:25:25 EDT 2004 i686
> i686 i386 GNU/Linux
> [20:21:38]opus::~ $
>
> thanks,
> Sudhakar.
>
>
>
> Style sheet:
>
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>         <xsl:output method="xml" />
>         <xsl:template match="*">
>
>                                         <xsl:attribute-set name="hello">
>                                                  <xsl:attribute
> name="font-size">12pt</xsl:attribute>
>                                         </xsl:attribute-set>

<xsl:attribute-set> is a "top-level" element, so it is not allowed to occur as
a child of a template (hence, when the processor encounters it, it cannot be
"compiled", and the error message is produced).  You should re-position it
such that it is a child of the root node.

>                                         <xsl:element name="testing"
> use-attribute-sets="hello">
>                                                 whats up?
>                                         </xsl:element>
>         </xsl:template>
> </xsl:stylesheet>
>
>
>
>
> XML file:
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>         <xsl:output method="xml" />
>         <xsl:template match="*">
>
>                                         <xsl:attribute-set name="hello">
>                                                  <xsl:attribute
> name="font-size">12pt</xsl:attribute>
>                                         </xsl:attribute-set>
>                                         <xsl:element name="testing"
> use-attribute-sets="hello">
>                                                 whats up?
>                                         </xsl:element>
>         </xsl:template>
> </xsl:stylesheet>
>
>
>
>
>
>
> Sudhakar Govindavajhala	                  Department of Computer Science
> Graduate Student,                         Princeton University

I would be glad to admit that the error message which you receive is somewhat
less that fully informative :-).  Users are more than welcome to submit
patches to the code to improve this situation!

Bill



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