[mod_python] CSS sheets and XML formatting - Maybe apache config?

ecastro1981-misc at yahoo.com ecastro1981-misc at yahoo.com
Fri Oct 20 19:03:11 EDT 2006


Hi,

Sorry I am a newbie. I have been testing out the following example from the CSS wikipedia article but I do not get the same output as displayed in wikipedia. As an actual xml file with a css page it works but I think I am doing something wrong with the modpython handlers.

http://en.wikipedia.org/wiki/Cascading_Style_Sheets

my file is test.py
===========================
from mod_python import apache

def say(req, what="NOTHING"):
    return "I am saying %s" % what

def test4(req):
    req.content_type = 'text/xml; charset=UTF-8'
    req.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
    req.write("<?xml-stylesheet type=\"text/css\" href=\"C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\css.css\"?>")
    req.write("<schedule>")
    req.write("<date>Tuesday 20 June</date>")
    req.write("<programme>")
    req.write("<starts>6:00</starts>")
    req.write("<title>News</title>")
    req.write("With Michael Smith and Fiona Tolstoy.")
    req.write("Followed by Weather with Malcolm Stott.")
    req.write("</programme>")
    req.write("<programme>")
    req.write("<starts>6:30</starts>")
    req.write("<title>Regional news update</title>")
    req.write("Local news for your area.")
    req.write("</programme>")
    req.write("<programme>")
    req.write("<starts>7:00</starts>")
    req.write("<title>Unlikely suspect</title>")
    req.write("Whimsical romantic crime drama starring Janet")
    req.write("Hawthorne and Percy Trumpp.")
    req.write("</programme>")
    req.write("</schedule>")
    return


def test5(req):
    req.content_type = 'text/xml; charset=UTF-8'
    req.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
    req.write("<?xml-stylesheet type=\"text/css\" href=\"css.css\"?>")
    req.write("<schedule>")
    req.write("<date>Tuesday 20 June</date>")
    req.write("<programme>")
    req.write("<starts>6:00</starts>")
    req.write("<title>News</title>")
    req.write("With Michael Smith and Fiona Tolstoy.")
    req.write("Followed by Weather with Malcolm Stott.")
    req.write("</programme>")
    req.write("<programme>")
    req.write("<starts>6:30</starts>")
    req.write("<title>Regional news update</title>")
    req.write("Local news for your area.")
    req.write("</programme>")
    req.write("<programme>")
    req.write("<starts>7:00</starts>")
    req.write("<title>Unlikely suspect</title>")
    req.write("Whimsical romantic crime drama starring Janet")
    req.write("Hawthorne and Percy Trumpp.")
    req.write("</programme>")
    req.write("</schedule>")
    return


I was hoping a call to test4 or test5 would pickup the css file but nothing happened. Does my apache conf file need something else. I strongly suspect I need to declare some directory in my apache conf file, but I am stuck.

Should I create an xml file and then send it over? Or is does this call for cString?

Any help with this would be appreciated.

Thank You,
E


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20061020/5259c60f/attachment.html


More information about the Mod_python mailing list