[Zope] Re: External script generates xml - how to turn it into an xml file object

Dieter Maurer dieter@handshake.de
Sat, 8 Sep 2001 23:43:26 +0200 (CEST)


abulka@netspace.net.au writes:
 > Ok sounds good.  Trouble is how to get that string into zope!  You 
 > see, passing back xml text containing "<" or ">" from my external 
 > script doesn't seem to work.  If my external script passes back a 
 > normal string - fine.  If there are tags in the string, they 
 > magically get stripped out :-(
 > I assume this has something to do 
 > with trying to send xml text within zope's xml-rpc mechanisms - but I 
 > am just guessing here.
Maybe, I start to understand....

   With "external script" you do not mean an "External Method"
   but a script run outside Zope?

   What method do you use to send the string to Zope?
   HTML, XML-RPC?

 > e.g. my external method is

 > 
 > def returnBigString():
 >     return 'Hi <fred>from the external method</fred>'
 > 
 > but zope only ends up seeing the string 
 >             "Hi from the external method"
Seems, you do speak of an External Method.
Then, I can assure you that the "<...>" are *NOT* stripped!

What you see is almost surely an illusion because you view
the method's return value as HTML.
Because the HTML browser does not recognize your tags
(e.g. '<fred>'), it silently ignores them.
Look at the HTML source and you will see them...
Alternatively, set the Content Type to "text/plain":

       RESPONSE.setHeader('Content-Type','text/plain')


Dieter