[XML-SIG] 4Suite problems

Anders Bruun Olsen anders@bruun-olsen.net
Fri, 13 Dec 2002 01:24:19 +0100


Hi,

I am not 100% sure that this is the right place to seek help - please
direct me to the right place if I am off-topic.

I am trying to make an app that amongst other things applies an XSLT to
an XML file to produce HTML. I have made the XSLT and the following
code:

def ProcessFile(input, output):
        XSLT = open("ujds.xslt", "r").read()

        XML = open(input, "r").read()

        xsltprocessor = Processor()
        
        transform = InputSource.DefaultFactory.fromString(XSLT)
        document = InputSource.DefaultFactory.fromString(XML)

        xsltprocessor.appendStylesheet(transform)
        result = xsltprocessor.run(document)
        if result:
                open(output, "w").write(result)

Whenever I run the app and try to run the ProcessFile function I get
this crash:

./print.py:64: RuntimeWarning: Creation of InputSource without an URI
  transform = InputSource.DefaultFactory.fromString(XSLT)
/usr/lib/python2.2/site-packages/Ft/Xml/InputSource.py:147: RuntimeWarning: Creation of InputSource without an URI
  return apply(self.fromStream, (stream,uri)+v_args, kw_args)
./print.py:65: RuntimeWarning: Creation of InputSource without an URI
  source = InputSource.DefaultFactory.fromString(XML)
Traceback (most recent call last):
  File "./print.py", line 119, in ?
    app = IndeksApp(0)
  File "/usr/lib/python2.2/site-packages/wxPython/wx.py", line 1581, in __init__
    _wxStart(self.OnInit)
  File "./print.py", line 108, in OnInit
    self.mainframe = MainFrame(NULL, -1, "UJDS Indeks")
  File "./print.py", line 89, in __init__
    if ProcessFile(inputfile, outputfile):
  File "./print.py", line 68, in ProcessFile
    result = xsltprocessor.run(document)
  File "/usr/lib/python2.2/site-packages/Ft/Xml/Xslt/Processor.py", line 150, in run
    raise XsltException(Error.SOURCE_PARSE_ERROR, iSrc.uri or '<Python string>', e)
Ft.Xml.Xslt.XsltException: Source document (urn:uuid:303010c-b08-503-20b-f050b09309): Invalid base URI: urn:uuid:303010c-b08-503-20b-f050b09309

What am I doing wrong here?

-- 
Anders
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/O d--@ s:+ a-- C++ $UL+++ P++ L+++ E- W+ N(+) o K? w O- M-- V
PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b+ DI+++ D+ G e- h !r y?
------END GEEK CODE BLOCK------
PGPKey: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8BFECB41