[4suite] 4Suite Reliance on ENVIRONMENT & global variables

Michael Olson Mike.Olson at fourthought.com
Tue Jan 21 06:23:13 CET 2003


> The strange thing is that if I directly output the XML source without
> doing any XSLT processing, the XML source appears correctly.  Somewhere
> along the line where the strings are being passed from the python
> libraries to the 4Suite libraries (by Py_ParseArgs..???), the strings
> are being 'miscommunicated'.
>

By "output the XML source" do you mean just print it out (or fetch it 
from the file system) ro do you mean parse it into DOM, and print it 
out?

If not the later, can you try that instead of XSLT to see if this works.

Thanks
Mike

> Now, it might be a Python2.2.2 issue since libxml2/libxslt from the
> gnome project are having similar problems as well.
>
> In 4Suite, do the apps embedd the python interpretor or do the apps
> start purely from a python environment?
>
> It might be good to check to see whether this problem still occurs 
> other
> 'python embedded' application (ie. uses Py_NewInterpretor from C). I
> forget, does the command-line version of python dynamically link to the
> python libraries?  If so, I wonder if the command-line version of 
> python
> is doing anything special or different when it links up and initializes
> the python libraries.
>
> I'm reposting this message on to the Python mailing list to see if
> anybody there can help give us a clue.
>
> P.S Has there been any changes in Python2.2.3+ that might possibly fix
> this problem?
>
> On Mon, 2003-01-20 at 22:28, Uche Ogbuji wrote:
>> On Mon, 2003-01-20 at 14:52, Mongryong wrote:
>>> Hi,
>>>
>>> I'm having trouble getting the latest 4Suite XML/XSLT tools to work 
>>> the
>>> way I want in mod_python and I know I'm not the first one to 
>>> experience
>>> "out-of-the-box" success.
>>>
>>> I've determined that it's an encoding issue.   Now, with a 
>>> stand-alone
>>> script or CGI script under Apache, 4XSLT works fine.  But under
>>> mod_python (which doesn't have access to ENVIRONMENT variables), 
>>> 4XSLT
>>> library decodes the XML source file in a total different encoding.  
>>> XSL
>>> templates (ie. <xsl:template name="blah">) are never executed because
>>> the XML tag is never recognized by the XSL processor.  Hence, you 
>>> get an
>>> empty output.
>>>
>>> I've check the default system encoding codec and it returns 'ascii' 
>>> (ie.
>>> sys.getdefaultencoding).  Now, it could be that the python library
>>> relies on some ENVIRONMENT variable for its configuration.
>>>
>>> Anybody have any ideas what 'parameters' might not be initialized
>>> properly under a non-CGI or non-shell environment such as mod_python?
>>> Or, is there a parameter that one can set to change the XML input
>>> decoding?
>>
>> I don't think there is any environment variable that could affect 
>> this.
>>
>> However, there have been a lot of fixes recently, including to some
>> endianness bugs.  Do you mind trying again with latest 4Suite CVS and
>> telling us if it helps?  Either wait till tomorrow's snapshot, or 
>> check
>> out current CVS HEAD directly
>>
>> http://4suite.org/docs/4SuiteCVS.xml
>>
>> If it doesn't help, I hope you'll be able to help us work with you to
>> find a solution for mod_python users.
>>
>> -- 
>> Uche Ogbuji                                    Fourthought, Inc.
>> http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
>> Python Generators + DOM - 
>> http://www.xml.com/pub/a/2003/01/08/py-xml.html
>> 4Suite Repository Features - 
>> https://www6.software.ibm.com/reg/devworks/dw-x4suite5-i/
>> XML class warfare - http://www.adtmag.com/article.asp?id=6965
>> MusicBrainz  metadata - 
>> http://www-106.ibm.com/developerworks/xml/library/x-think14.html
>>
>
> <main.py>
Mike Olson                                Principal Consultant
mike.olson at fourthought.com                +1 303 583 9900 x 102
Fourthought, Inc.                         http://Fourthought.com
PO Box 270590,                            http://4Suite.org
Louisville, CO 80027-5009, USA
XML strategy, XML tools, knowledge management






More information about the Python-list mailing list