[XML-SIG] [ pyxml-Bugs-581609 ] keyerror on appendStylesheetUri()

noreply@sourceforge.net noreply@sourceforge.net
Mon, 15 Jul 2002 02:32:51 -0700


Bugs item #581609, was opened at 2002-07-15 02:32
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=581609&group_id=6473

Category: 4Suite
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: keyerror on appendStylesheetUri()

Initial Comment:
Software used is:
- Python 2.2.1
- PyXML 0.7.1
- 4Suite 0.11.1

After manual updating the installation (see broken
install on unix), I checked an example from "Python &
XML" Chapter 6, pp.146.

Python 2.2.1 (#7, Jul 15 2002, 10:12:28) [C] on irix-n32
Type "help", "copyright", "credits" or "license" for
more information.
>>> from xml.xslt.Processor import Processor
>>> xmlp = Processor()
>>> xmlp.appendStylesheetUri('koord.xsl')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/opt/python/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py",
line 101, in appendStylesheetUri
    sty = self._styReader.fromUri(styleSheetUri, baseUri)
  File
"/opt/python/lib/python2.2/site-packages/_xmlplus/xslt/StylesheetReader.py",
line 579, in fromUri
    ownerDoc, stripElements)
  File
"/opt/python/lib/python2.2/site-packages/Ft/Lib/ReaderBase.py",
line 76, in fromUri
    rt = self.fromStream(stream, newBaseUri, ownerDoc,
stripElements) 
  File
"/opt/python/lib/python2.2/site-packages/_xmlplus/xslt/StylesheetReader.py",
line 622, in fromStream
    sheet.setup()
  File
"/opt/python/lib/python2.2/site-packages/_xmlplus/xslt/Stylesheet.py",
line 140, in setup
    self._setupChildNodes()
  File
"/opt/python/lib/python2.2/site-packages/_xmlplus/xslt/Stylesheet.py",
line 183, in _setupChildNodes
    curr_node.setup()
  File
"/opt/python/lib/python2.2/site-packages/_xmlplus/xslt/TemplateElement.py",
line 46, in setup
    namespaces=self._nss
  File
"/opt/python/lib/python2.2/site-packages/_xmlplus/xpath/Util.py",
line 83, in ExpandQName
    split_name = (nss[prefix], local)
KeyError
>>> 
The value return by xml.dom.ext.SplitQName(qname) isn't
a string as expected. The return value is None.
Therefore the if construct should be
if prefix and prefix != '':
After this change the example executes as expected.


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

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