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




great!  that fixes it.  But what is the idea of making attribute sets
top-level? Does that not mean the corresponding attribute values are
fixed? Can someone explain a bit in detail?  Alternatively, since I am
able to change the values inside, why not allow attribute sets be
non-toplevel?

Am I missing something?

Sudhakar.


The following code works:  (hello top level)


<xsl:attribute-set name="hello">
     <xsl:attribute name="font-size">12pt</xsl:attribute>
     <xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>


<xsl:element name="testing" use-attribute-sets="hello">
     <xsl:attribute name="hibben"> maggie </xsl:attribute>
            whats up?
</xsl:element>


to get


<testing font-size="12pt" font-weight="bold" hibben="maggie">
               whats up?
</testing>








On Wed, 12 Jan 2005, William M. Brack wrote:

> 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
>

Sudhakar.



Sudhakar Govindavajhala	                  Department of Computer Science
Graduate Student,                         Princeton University
Ph : (lab) +1 609 258 1763                   (office) +1 609 258 1798
               http://www.cs.princeton.edu/~sudhakar


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