[XML-SIG] [Bug #128851] 4xslt (0.10.0) crash
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 15 Jan 2001 05:53:11 -0800
Bug #128851, was updated on 2001-Jan-15 05:53
Here is a current snapshot of the bug.
Project: Python/XML
Category: 4Suite
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: ornicar
Assigned to : nobody
Summary: 4xslt (0.10.0) crash
Details:
When running the command "4xslt bugnicar-database.xml bugnicar-insert.xslt"
I get a traceback (see below). The error occurs with both 4Suite 0.10.0 and
0.10.1beta3
Traceback (innermost last):
File "/usr/bin/4xslt", line 5, in ?
_4xslt.Run(sys.argv)
File "/usr/lib/python1.5/site-packages/xml/xslt/_4xslt.py", line 94, in
Run
topLevelParams=top_level_params)
File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 130,
in runUri
writer, uri, outputStream)
File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 202,
in runNode
self.applyTemplates(context, None)
File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 222,
in applyTemplates
self.applyBuiltins(context, mode)
File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 235,
in applyBuiltins
self.applyTemplates(context, mode)
File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 218,
in applyTemplates
found = sty.applyTemplates(context, mode, self, params)
File "/usr/lib/python1.5/site-packages/xml/xslt/Stylesheet.py", line 353,
in applyTemplates
patternInfo[TEMPLATE].instantiate(context, processor, params)
File "/usr/lib/python1.5/site-packages/xml/xslt/TemplateElement.py", line
115, in instantiate
context = child.instantiate(context, processor)[0]
File "/usr/lib/python1.5/site-packages/xml/xslt/LiteralElement.py", line
91, in instantiate
context = child.instantiate(context, processor)[0]
File "/usr/lib/python1.5/site-packages/xml/xslt/AttributeElement.py",
line 60, in instantiate
processor.writers[-1].attribute(name, value, namespace)
File "/usr/lib/python1.5/site-packages/xml/xslt/XmlWriter.py", line 89,
in attribute
self._currElement.attrs[name] = TranslateCdataAttr(value)
AttributeError: 'None' object has no attribute 'attrs'
Here the XSLT file "bugnicar-insert.xslt":
----------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1"
indent="yes"/>
<xsl:strip-space elements='*'/>
<!-- Narval prototype
====================================================== -->
<prototype>
<description lang="fr">Insérer un nouveau bug dans la base de données de
Bugnicar.</description>
<description lang="en">Insert a new bug in Bugnicar's
database.</description>
<input><match>bugnicar-task/bug-report</match></input>
<input><match>bugnicar-database</match></input>
<output><match>bugnicar-database</match></output>
</prototype>
<!-- root
================================================================== -->
<xsl:template match='//bug-report'>
<xsl:variable name='date' select='@date'/>
<xsl:variable name='sender' select='@sender'/>
<xsl:variable name='about' select='@about'/>
<xsl:variable name='description' select='text()'/>
<xsl:variable name='newid'>
<xsl:choose>
<xsl:when test='@new-id'><xsl:value-of
select='@new-id'/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:template>
<xsl:template match='//bugnicar-database'>
<bugnicar-database>
<xsl:copy-of select='*'/>
<bug id='{$newid}' status='open' about='{$about}'
assigned='nobody'>
<report date='{$date}' from='{$sender}' about='{$about}'>
<xsl:value-of select='$description'/>
</report>
</bug>
<xsl:attribute name='new-id'>
<xsl:value-of select='$newid+1'/>
</xsl:attribute>
</bugnicar-database>
</xsl:template>
</xsl:transform>
And here the XML file bugnicar-database.xml:
-------------------------------------------
<bugnicar-database>
</bugnicar-database>
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=128851&group_id=6473