[4suite] TextWriter bug ?
Mike Olson
Mike.Olson at fourthought.com
Thu Sep 21 20:06:17 MDT 2000
Alexandre Fayolle wrote:
>
> Hello...
hmm... Itried to reproduce this and I couldn't.....
[molson at penny xsltTest]$ 4xslt -i freshmeat.rdf toto.xsl
<?xml version='1.0'?>
<html-body><h1><h2>freshmeat.net</h2><table><tr><td>Description:</td><td>the
one-stop-shop for all your Linux software
needs</td></tr><tr><td>URL:</td><td><a
href='http://freshmeat.net'>http://freshmeat.net</a></td></tr></table><h3>Alzabo
0.06a</h3><table><tr><td>
Description:
</td><td>Perl data modelling tool and RDBMS-OO mapper.</td></tr><tr><td>
More detail at:
</td><td><a
href='http://freshmeat.net/news/2000/07/19/964065475.html'>http://freshmeat.net/news/2000/07/19/964065475.html</a></td></tr></table><h3>HLmaps
0.90</h3><table><tr><td>
Description:
</td><td>A Perl/CGI script for Half-Life servers to present a list of
loaded maps</td></tr><tr><td>
More detail at:
</td><td><a
href='http://freshmeat.net/news/2000/07/19/964065450.html'>http://freshmeat.net/news/2000/07/19/964065450.html</a></td></tr></table></h1></html-body>
[molson at penny xsltTest]$
>
> Sorry, more bad news :o(
>
> Tough evening, is it not?
>
> We are experiencing a strange behaviour of 4xslt. Attached to this mail
> are an xsl transformation and a rdf file. The xsl transformation is
> supposed to output some html from the rdf, it's pretty standard.
>
> When we process this using DomWriter (patched, with the patched
> Document.py and Element.py as in my previous mail), everything goes
> fine. If we use TextWriter, the crowd goes wild (and python too):
>
> [alf at leo journal]$ python ../xslt.py freshmeat.rdf toto.xsl > toto.html
> Traceback (innermost last):
> File "../xslt.py", line 21, in ?
> test()
> File "../xslt.py", line 16, in test
> result =
> processor.runNode(xml_dom,ignorePis=1)#,writer=DomWriter.DomWriter())
> File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 395,
> in runNode
> self.applyTemplates(context, None)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 417,
> in applyTemplates
> self.applyBuiltins(context, mode)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 431,
> in applyBuiltins
> self.applyTemplates(context, mode)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 413,
> in applyTemplates
> found = sty.applyTemplates(context, mode, self, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Stylesheet.py", line
> 636, in applyTemplates
> patternInfo[TEMPLATE].instantiate(context, processor, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/TemplateElement.py",
> line 254, in instantiate
> context = child.instantiate(context, processor)[0]
> File "/usr/lib/python1.5/site-packages/xml/xslt/LiteralElement.py", line
> 237, in instantiate
> context = child.instantiate(context, processor)[0]
> File "/usr/lib/python1.5/site-packages/xml/xslt/LiteralElement.py", line
> 237, in instantiate
> context = child.instantiate(context, processor)[0]
> File
> "/usr/lib/python1.5/site-packages/xml/xslt/ApplyTemplatesElement.py", line
> 173, in instantiate
> processor.applyTemplates(context, mode, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 413,
> in applyTemplates
> found = sty.applyTemplates(context, mode, self, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Stylesheet.py", line
> 636, in applyTemplates
> patternInfo[TEMPLATE].instantiate(context, processor, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/TemplateElement.py",
> line 254, in instantiate
> context = child.instantiate(context, processor)[0]
> File "/usr/lib/python1.5/site-packages/xml/xslt/LiteralElement.py", line
> 237, in instantiate
> context = child.instantiate(context, processor)[0]
> File "/usr/lib/python1.5/site-packages/xml/xslt/LiteralElement.py", line
> 237, in instantiate
> context = child.instantiate(context, processor)[0]
> File "/usr/lib/python1.5/site-packages/xml/xslt/LiteralElement.py", line
> 237, in instantiate
> context = child.instantiate(context, processor)[0]
> File
> "/usr/lib/python1.5/site-packages/xml/xslt/ApplyTemplatesElement.py", line
> 173, in instantiate
> processor.applyTemplates(context, mode, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 413,
> in applyTemplates
> found = sty.applyTemplates(context, mode, self, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/Stylesheet.py", line
> 636, in applyTemplates
> patternInfo[TEMPLATE].instantiate(context, processor, params)
> File "/usr/lib/python1.5/site-packages/xml/xslt/TemplateElement.py",
> line 252, in instantiate
> context = child.instantiate(context, processor)[0]
> File "/usr/lib/python1.5/site-packages/xml/xslt/ElementElement.py", line
> 191, in instantiate
> context = child.instantiate(context, processor)[0]
> File "/usr/lib/python1.5/site-packages/xml/xslt/AttributeElement.py",
> line 193, in instantiate
> processor.writers[-1].attribute(name, value, namespace)
> File "/usr/lib/python1.5/site-packages/xml/xslt/TextWriter.py", line
> 192, in attribute
> self.__currElement.attrs[name] = value
> AttributeError: 'None' object has no attribute 'attrs'
>
> Well, I think I'll leave you on this one for tonight. I can't help
> thinking it's a good thing that ther's an 8 hours time shift between Paris
> and Boulder. Gives you time to work while we go to sleep and stop mail
> bombing the list.
>
> --
> Alexandre Fayolle & Nicolas Chauvat
> Crazy frenchies
> http://www.logilab.com - "Mais o est donc Ornicar ?" -
> LOGILAB, Paris (France).
>
> ------------------------------------------------------------------------
> Name: toto.xsl
> toto.xsl Type: Plain Text (TEXT/PLAIN)
> Encoding: BASE64
>
> Name: freshmeat.rdf
> freshmeat.rdf Type: Plain Text (TEXT/PLAIN)
> Encoding: BASE64
--
Mike Olson Principal Consultant
mike.olson at fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
More information about the 4suite
mailing list