Python seems to render html, can this be turned off or escaped?
I am trying to pass a string into a dtml document (from python) that contains html code, however I don't want python to render it, just pass it. As an example... mystring = "<html><body<h1> test1 </h1></body></html>" return mystring 'mystring' needs to be returned to my DTML document as a string, not as rendered html (which it seems to do automatically). Is this possible to do? Thanks for any help Wayne
From: "Guidry, Wayne" <wguidry@anteon.com>
I am trying to pass a string into a dtml document (from python) that contains html code, however I don't want python to render it, just pass it.
As an example...
mystring = "<html><body<h1> test1 </h1></body></html>" return mystring
'mystring' needs to be returned to my DTML document as a string, not as rendered html (which it seems to do automatically). Is this possible to do?
I don't think python is converting the string to html. What are you doing with the string once it is in the dtml method (ie. how did you invoke the python script?) Something like: <dtml-call "REQUEST.set('avar', myScript() )"> or <dtml-let avar="myScript()"> should put the data from 'mystring' as text into the dtml variable 'avar' if you do: <dtml-var myscript> then dtml will render the contents of mystring to html If you are still having problems, post another message with the dtml & python code. HTH Jonathan
participants (2)
-
Guidry, Wayne -
Jonathan Hobbs