[XML-SIG] [ pyxml-Bugs-412235 ] xml.xslt.RtfWriter broken

noreply@sourceforge.net noreply@sourceforge.net
Thu, 29 Mar 2001 09:31:23 -0800


Bugs item #412235, was updated on 2001-03-29 09:31
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=412235&group_id=6473

Category: 4Suite
Group: None
Status: Open
Priority: 5
Submitted By: Alexandre Fayolle (afayolle)
Assigned to: Nobody/Anonymous (nobody)
Summary: xml.xslt.RtfWriter broken

Initial Comment:
When trying to process an XSLT outputting a pDomlette
document fragment, runNode will fail with the following
traceback :

>>> frag = p.runNode(element,1,{},RtfWriter(None,d2))
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python1.5/site-packages/xml/xslt/Processor.py",
line 186, in runNode
    baseUri, outputStream)
  File
"/usr/lib/python1.5/site-packages/xml/xslt/Processor.py",
line 244, in execute
    self.writers[-1].startDocument()
AttributeError: startDocument


The problem lies in RtfWriter, which shoudl inherit
from NullWriter (which provides default implementation
for all writer method). Here's a patch:

--- /tmp/RtfWriter.py   Thu Mar 29 19:25:01 2001
+++ RtfWriter.py        Thu Mar 29 19:26:05 2001
@@ -19,8 +19,9 @@
 from Ft.Lib import pDomlette
 from xml.dom.ext import SplitQName
 from xml.dom import XMLNS_NAMESPACE
+from xml.xslt import NullWriter
 
-class RtfWriter:
+class RtfWriter(NullWriter.NullWriter):
     def __init__(self, outputParams, ownerDoc):
         self.__ownerDoc = ownerDoc
         self.__root =
pDomlette.DocumentFragment(ownerDoc)


Cheers

Alexandre




----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=412235&group_id=6473