xslt on windows

Sam Brauer sam at webslingerz.com
Mon Jul 1 09:08:26 EDT 2002


If you're using 4Suite-0.12.0, there is no xml.xslt to import.
Instead, you should import Ft.Xml.Xslt.
This is mentioned at
http://4suite.org/docs/howto/UNIX.xml
in the section "Important for Application Developers".

This is the case regardless of OS.

Here's a really basic example of usage:

import Ft.Xml.Xslt.Processor, Ft.Xml.InputSource
import sys

if(len(sys.argv) < 3):
     sys.stderr.write("usage: %s style.xsl doc.xml\n" % sys.argv[0])
     sys.exit(1)

processor = Ft.Xml.Xslt.Processor.Processor()

f = open(sys.argv[1])
xsl_data = f.read()
f.close()

f = open(sys.argv[2])
xml_data = f.read()
f.close()

processor.appendStylesheet(Ft.Xml.InputSource.DefaultFactory.fromString(xsl_data, 
"uri"))
result = 
processor.run(Ft.Xml.InputSource.DefaultFactory.fromString(xml_data, "uri"))
processor.reset()

print xml_data


(Some of the long lines at the end of the script may have
unintended linebreaks.)

By the way, it would probably be best to ask about this sort of thing on 
4suite's mailing list...
http://lists.fourthought.com/mailman/listinfo/4suite


Tim Rowe wrote:
> I suspect that's the same problem I'm having with 4suite under Windows
> ME, but nobody has come back to me, either. I don't really know where
> to go next except maybe to report it as a bug (at least in the
> installation script if not in 4suite itself)
> 
> On Fri, 28 Jun 2002 17:26:01 +0200, "Marko Faldix" <mf at mrinfo.de>
> wrote:
> 
> 
>>Hello,
>>
>>I tried installing 4suite's xslt on Win 2000, but I really don't know how to
>>deal with pathes.
>>
>>I used
>>
>> Python-2.2.1.exe
>> win32all-146.exe
>> 4Suite-0.12.0a2.win32-py2.2.exe
>>
>>All scripts, wether if command-line or through web server, doesn't know
>>module xml.xslt.
>>
>>Unfortunately, you can't import a module   *.site-packages.*, where * is
>>anything, because "-" is forbidden as part of module names.
>>
>>Also, you can't copy directories from site-packages to c:\python22, they
>>don't work properly then.
>>
>>Is there anybody using xslt with python? Maybe better with linux in place of
>>windows?
>>
>>Best wishes,
>>--
>>Marko Faldix
>>M+R Infosysteme
>>Hubert-Wienen-Str. 24     52070 Aachen
>>Tel.: 0241-93878-16     Fax.:0241-875095
>>E-Mail: marko.faldix at mplusr.de
>>
>>
> 
> 








More information about the Python-list mailing list