Anybody using 4suite for xslt processing?
Marko Faldix
mf at mrinfo.de
Thu Jul 25 07:57:22 EDT 2002
Now this worked:
First of all, we didn't have pyxml installed. So I uninstalled python and
4suite. Then I installed python22, then pyxml for python22 and then 4suite
for python22 on Win 2000 Server.
Then I have a file called exslt.xml with xml data from an older
documentation somewhere:
<?xml version="1.0"?>
<!-- *********** Resumes for People *********** -->
<PEOPLE>
<PERSON PERSONID="p1">
<NAME>Mark Wilson</NAME>
<ADDRESS>911 Somewhere Circle, Canberra, Australia</ADDRESS>
<TEL>(++612) 12345</TEL>
<FAX>(++612) 12345</FAX>
<EMAIL>markwilson at somewhere.com</EMAIL>
</PERSON>
<PERSON PERSONID="p2">
<NAME>Tracey Wilson</NAME>
<ADDRESS>121 Zootle Road, Cape Town, South Africa</ADDRESS>
<TEL>(++2721) 531 9090</TEL>
<FAX>(++2721) 531 9090</FAX>
<EMAIL>Tracey Wilson at somewhere.com</EMAIL>
</PERSON>
<PERSON PERSONID="p3">
<NAME>Jodie Foster</NAME>
<ADDRESS>30 Animal Road, New York, USA</ADDRESS>
<TEL>(++1) 3000 12345</TEL>
<FAX>(++1) 3000 12345</FAX>
<EMAIL>Jodie Foster at somewhere.com</EMAIL>
</PERSON>
<PERSON PERSONID="p4">
<NAME>Lorrin Maughan</NAME>
<ADDRESS>1143 Winners Lane, London, UK</ADDRESS>
<TEL>(++94) 17 12345</TEL>
<FAX>(++94) 17 12345</FAX>
<EMAIL>Lorrin Maughan at somewhere.com</EMAIL>
</PERSON>
<PERSON PERSONID="p5">
<NAME>Steve Rachel</NAME>
<ADDRESS>90210 Beverly Hills, California, USA</ADDRESS>
<TEL>(++1) 2000 12345</TEL>
<FAX>(++1) 2000 12345</FAX>
<EMAIL>Steve Rachel at somewhere.com</EMAIL>
</PERSON>
</PEOPLE>
Further a file called exslt.xsl:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<HTML>
<BODY>
<TABLE BORDER="2">
<TR>
<TD>Name</TD>
<TD>Address</TD>
<TD>Tel</TD>
<TD>Fax</TD>
<TD>Email</TD>
</TR>
<xsl:for-each select="PEOPLE/PERSON">
<TR>
<TD><xsl:value-of select="NAME"/></TD>
<TD><xsl:value-of select="ADDRESS"/></TD>
<TD><xsl:value-of select="TEL"/></TD>
<TD><xsl:value-of select="FAX"/></TD>
<TD><xsl:value-of select="EMAIL"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
And finally the file exslt.py:
-----
from Ft.Xml.Xslt import Processor
from Ft.Xml import InputSource
processor = Processor.Processor()
transform =
InputSource.DefaultFactory.fromUri("http://marko.ourhost/python/exslt.xsl")
processor.appendStylesheet(transform)
source =
InputSource.DefaultFactory.fromUri("http://marko.ourhost/python/exslt.xml")
result = processor.run(source)
print "Content-Type: text/html\n"
print result
-----
Then I called last one through webbrowser and it returns correct table of
persons.
Now there is one problem left. Every output is enhanced with
::: Using minidom
What's going wrong here? If I want to go in production state, such message
may not appear and isn't it a sort of warning?
--
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