Velocity Reviews

Velocity Reviews (
-   Python (
-   -   4Suite and XSLT problems (

Doug Farrell 08-05-2003 10:08 PM

4Suite and XSLT problems
Hi all,

I'm trying to use the 4Suite xml/xsl tools to transform some XML data
into HTML. I'm using some examples from the O'Reilly book "Python and
XML" and things are blowing up. Here is the little piece of code I'm
working on:

from xml.xslt.Processor import Processor

proc = Processor()

xsl = """<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
<xsl:template match="/">
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
<xsl:for-each select="catalog/cd">
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>

# here comes the problem

I'm not even getting to the transformation part, just trying to load
the xsl stylesheet. I've run the above xsl code, along with my xml
data though the command line 4xslt and it works fine. When I run the
line of Python code immediately above, I get a tracedump from Python
that looks like this:

Traceback (most recent call last):
File "/var/www/html/python/", line 44, in ?
File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/",
line 124, in appendStylesheetString
sty = self._styReader.fromString(text, baseUri)
File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/",
line 570, in fromString
return pDomletteReader.PyExpatReader.fromString(self,st,
refUri='', ownerDoc=None, stripElements=None)
File "/usr/lib/python2.2/site-packages/Ft/Lib/", line
67, in fromString
rt = self.fromStream(stream, refUri, ownerDoc, stripElements)
File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/",
line 622, in fromStream
File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/",
line 140, in setup
File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/",
line 183, in _setupChildNodes
File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/",
line 46, in setup
File "/usr/lib/python2.2/site-packages/_xmlplus/xpath/", line
83, in ExpandQName
split_name = (nss[prefix], local)

I'm at a loss as to what to do and where to go from here. I'm running
Python 2.2.2 on a RedHat 9.0 system and I downloaded and installed
4Suite 1.0.* from (though I don't think that was

If anyone has some suggestions what I'm doing wrong, I'd very very
glad to hear them. Thanks in advance,

Doug Farrell

Doug Farrell 08-12-2003 12:19 PM

Re: 4Suite and XSLT problems (Uche Ogbuji) wrote in message news:< com>...
> Your answers are here:
> --Uche


Thank you very much for the response, that is a big help to me and
I'll try and implement your suggestions. I'll post back here to let
you know of my success.

Again, thanks!

All times are GMT. The time now is 01:03 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.