[XML-SIG] 4Suite problems
Uche Ogbuji
uche.ogbuji@fourthought.com
Fri, 13 Dec 2002 15:44:32 -0700
> On Fri, Dec 13, 2002 at 01:50:41PM -0700, Uche Ogbuji wrote:
> > Hmm. Works for me. Try this script and tell me what you get:
> > TRANSFORM = """<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="1.0">
> > <xsl:template match="@*|node()">
> > <xsl:copy>
> > <xsl:apply-templates select="@*|node()"/>
> > </xsl:copy>
> > </xsl:template>
> > </xsl:stylesheet>
> > """
> > SOURCE = """<spam id="eggs">I don't like spam</spam>"""
> > processor = Processor.Processor()
> > from Ft.Xml.Domlette import NonvalidatingReader
> > #Create a DOM for the transform
> > transform = NonvalidatingReader.parseString(TRANSFORM,
> > "http://spam.com/identity.xslt")
> > #Create a DOM for the source document
> > source = NonvalidatingReader.parseString(SOURCE, "http://spam.com/doc.xml")
> > processor.appendStylesheetNode(transform, "http://spam.com/identity.xslt")
> > result = processor.runNode(source, "http://spam.com/doc.xml")
> > print result
> > I get:
> > $ python domxslt.py
> > <?xml version='1.0' encoding='UTF-8'?>
> > <spam id='eggs'>I don't like spam</spam>
>
> I get:
>
> Traceback (most recent call last):
> File "test.py", line 23, in ?
> processor.appendStylesheetNode(transform, "http://spam.com/identity.xslt")
> AttributeError: Processor instance has no attribute 'appendStylesheetNode'
Oh. I now remember that appendStylesheetNode was only re-introduced in the
latest alpha release. You'll need 4Suite 0.12.0a3 or a recent CVS snapshot to
use it.
This might, in general, be a good idea because of this versioning confusion.
That way you can be sure of what you have :-)
Installing released version: http://4suite.org/docs/howto/UNIX.xml
Installing CVS version: http://4suite.org/docs/4SuiteCVS.xml
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Tour of 4Suite - http://www.xml.com/pub/a/2002/10/16/py-xml.html
Proper XML Output in Python - http://www.xml.com/pub/a/2002/11/13/py-xml.html
RSS for Python - http://www-106.ibm.com/developerworks/webservices/library/ws-p
yth11.html
Debug XSLT on the fly - http://www-106.ibm.com/developerworks/xml/library/x-deb
ugxs.html