From sean.upton at uniontrib.com Fri Jan 4 19:31:30 2002 From: sean.upton at uniontrib.com (sean.upton@uniontrib.com) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ParsedXML 1.2.1 / Zope 2.4.3 / DOM access via TTW PythonScripts Message-ID: Something is strange with my new setup; I had some TTW PythonScript code that worked in Zope 2.3 with ParsedXML 1.1, but that no longer works: dom = context['docsource'] #where docsource is the name #of a ParsedXML doc bylineNode = dom.getElementsByTagName('byline')[0] ---------------- Error Type: AttributeError
Error Value: __getattr__
Traceback (innermost last): File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/lib/zope/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: sean) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: readField_byline) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: readField_byline) File /usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: readField_byline) File /usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in _bindAndExec (Object: readField_byline) File /usr/lib/zope/lib/python/Products/PythonScripts/PythonScript.py, line 363, in _exec (Object: readField_byline) (Info: ({'script': <PythonScript instance at 9bbe1c8>, 'context': <Folder instance at 9b36828>, 'container': <Folder instance at 9b36828>, 'traverse_subpath': []}, (), {}, None)) File Script (Python), line 3, in readField_byline (Object: guarded_getitem) File /usr/lib/zope/lib/python/Products/ParsedXML/ParsedXML.py, line 252, in getElementsByTagName (Object: docsource) AttributeError: (see above) Any thoughts why this doesn't work? Sean ========================= Sean Upton Site Technology Supervisor Development & Integration SignOnSanDiego.com The San Diego Union-Tribune 619.718.5241 sean.upton@uniontrib.com ========================= From sean.upton at uniontrib.com Fri Jan 4 19:37:55 2002 From: sean.upton at uniontrib.com (sean.upton@uniontrib.com) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ParsedXML 1.2.1 / Zope 2.4.3 / DOM access via TTW PythonScripts Message-ID: I should be more specific; I upgraded Zope to 2.4.3 and then upgraded ParsedXML to 1.2.1, then to a checkout of cvs main from today... Now this sript won't work... Sean -----Original Message----- From: sean.upton@uniontrib.com [mailto:sean.upton@uniontrib.com] Sent: Friday, January 04, 2002 4:32 PM To: zope-xml@zope.org Subject: [Zope-xml] ParsedXML 1.2.1 / Zope 2.4.3 / DOM access via TTW PythonScripts Something is strange with my new setup; I had some TTW PythonScript code that worked in Zope 2.3 with ParsedXML 1.1, but that no longer works: dom = context['docsource'] #where docsource is the name #of a ParsedXML doc bylineNode = dom.getElementsByTagName('byline')[0] ---------------- Error Type: AttributeError
Error Value: __getattr__
Traceback (innermost last): File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/lib/zope/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: sean) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: readField_byline) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: readField_byline) File /usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: readField_byline) File /usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in _bindAndExec (Object: readField_byline) File /usr/lib/zope/lib/python/Products/PythonScripts/PythonScript.py, line 363, in _exec (Object: readField_byline) (Info: ({'script': <PythonScript instance at 9bbe1c8>, 'context': <Folder instance at 9b36828>, 'container': <Folder instance at 9b36828>, 'traverse_subpath': []}, (), {}, None)) File Script (Python), line 3, in readField_byline (Object: guarded_getitem) File /usr/lib/zope/lib/python/Products/ParsedXML/ParsedXML.py, line 252, in getElementsByTagName (Object: docsource) AttributeError: (see above) Any thoughts why this doesn't work? Sean ========================= Sean Upton Site Technology Supervisor Development & Integration SignOnSanDiego.com The San Diego Union-Tribune 619.718.5241 sean.upton@uniontrib.com ========================= _______________________________________________ Zope-xml mailing list Zope-xml@zope.org http://lists.zope.org/mailman/listinfo/zope-xml From saludes at cvc.uab.es Wed Jan 9 04:03:49 2002 From: saludes at cvc.uab.es (Jordi Saludes) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ParsedXML with latin-1 encoding Message-ID: <02010910132400.01096@cvc118.uab.es> Hi all, How can I put iso-latin-1 text in a ParsedXML instance? For instance If I write: Resum? in the edit textarea, I get: Error Type: UnicodeError Error Value: ASCII encoding error: ordinal not in range(128) Settings: Zope Version (Zope 2.4.1 (source release, python 2.1, linux2), python 2.1.0, linux2) Python Version 2.1 (#1, Jun 27 2001, 17:00:40) [GCC 2.95.3 20010315 (release)] System Platform linux2 ParsedXML (Installed product ParsedXML (ParsedXML 1.2.1)) --Jordi Saludes Universitat Politecnica de Catalunya / ma2 saludes@ma2.upc.es From bates at stat.wisc.edu Tue Jan 15 12:43:08 2002 From: bates at stat.wisc.edu (Douglas Bates) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Inverse relationship design in XML, Python, & Zope Message-ID: <6rd70bwlw3.fsf@franz.stat.wisc.edu> This is a design question but it does relate to XML, Python, and Zope so I hope it is not too far off-topic for these lists. I apologize for the length of the question. It seems that design questions often require a lot of explanation and background. I begin with XML representing, say, articles within issues within a volume of a journal. J. of the Amer. Statist. Assoc. 98 2001 455 September 785 793 Estimation of the ... Microscopy Higdon, Dave Yamamoto, Steve Blind deconvolution Magnetic imaging ... 456 ... This information is decomposed and stored, along with other types of bibliographic information, in a PostgreSQL database. We use Zope to provide the web interface for queries on this database. We would like to have the result of a query returned as an XML object that contains elements, each of which has complete information on a title that matches the query, where a title can be an article or a book or another type of reference. For example, a query could map to SQL like SELECT xmlrep FROM titles WHERE idTitle IN (SELECT idTitle FROM authors WHERE aname ~ 'Higdon, *' INTERSECT SELECT idTitle FROM authors WHERE aname ~ 'Yamamoto, *'); The way I envision it, the xmlrep corresponding to that jart element above would be, say, a pjart element (presentation of a journal article). It must include all the information on the article and the issue and the volume and the journal if we are to be able to format it. The entire result from the query might be J. of the Amer. Statist. Assoc. 98 2001 455 September 785 793 Estimation of the ... Microscopy Higdon, Dave Blind deconvolution Magnetic imaging Title of a book Book Publisher, Inc. Yamamoto, Steve Higdon, Dave ... This is what I meant by an inverse relationship design. I must get the information on the journal, volume, and issue when I select the article. The simple way to do this is to store the entire xmlrep for each title in the titles table. It works but it is not exactly elegant and it requires that we store a lot of redundant text in that xmlrep column. The more elegant solution is to construct the information from XML fragments or text fragments in several different tables in the database. Our tables are normalized so the journal table, with primary key idJournal, contains information on the journal, the issn, etc. and our jour_vol_issue table, with primary key idE, contains an idJournal, and a volume number, year, and issue number. SQL is designed to reconstruct this kind of information but it does so by returning rows in a query result and it would not be easy to make a single query return, say, information on articles and information on books. If we are going to store fragments that will be pasted together to create the XML for presenting a journal article or a book or a proceedings article or ..., where should we construct the XML and what are good tools to use to do this? We could: 0) Store all the information on each title in the xmlrep column and not do any processing. 1) Write a database function, say in PL/PGSQL, that constructs this XML on the fly from the different tables in the database. 2) Write DTML methods, Python methods or external Python methods for Zope. 3) Use XSLT or Xpath to reconstruct. I think know how to do 0, 1, or 2. I'm not sure about 3 because I don't yet know enough about XSL. Your suggestions will be appreciated. -- Douglas Bates bates@stat.wisc.edu Statistics Department 608/262-2598 University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/ From christophe.robert at culture.gouv.fr Wed Jan 16 06:13:27 2002 From: christophe.robert at culture.gouv.fr (christophe robert) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Inverse relationship design in XML, Python, & Zope References: <6rd70bwlw3.fsf@franz.stat.wisc.edu> Message-ID: <3C456057.FFE4ED2B@culture.fr> Douglas Bates a ?crit : > > > 3) Use XSLT or Xpath to reconstruct. > You can use nXMLDocument " or my ugly port on unix of nXMLDocument "uniXMLdocument" :(( " > > I think know how to do 0, 1, or 2. I'm not sure about 3 because I > don't yet know enough about XSL. > > Your suggestions will be appreciated. > > -- > Douglas Bates bates@stat.wisc.edu > Statistics Department 608/262-2598 > University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/ > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml From faassen at vet.uu.nl Thu Jan 17 06:36:52 2002 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Help test ParsedXML on Zope 2.5 Message-ID: <20020117113652.GA24462@vet.uu.nl> Hi there, Since the first Zope 2.5 betas have been coming out I've been testing ParsedXML with it. Unfortunately on the platforms I've tested it on I've seen some bad crashing behavior. Since they don't see this behavior at Zope corporation, I'd like to get some other people to test this, so we can track down the problem. Your help will be greatly appreciated! What you need to do: * be on a unix box, or be on windows with a compiler, as you still need to compile ParsedXML's Expat extension * download and install the latest Zope 2.5 beta, currently: http://www.zope.org/Products/Zope/2.5.0b4/ * download and install a ParsedXML tarball from CVS http://cvs.zope.org/Products/ParsedXML/ParsedXML.tar.gz?tarball=1 * compile the Expat extension. With the Python you use for Zope, in the Products/ParsedXML/Expat directory, do: python setup.py * now load a largish XML document into a ParsedXML document in this Zope. I myself have been using timon.xml, which can be found here: http://collector.zope.org/Zope/83/timon.xml * now go to the DOM tree view, and try to open nodes in the tree (and subnodes, etc). If Zope crashes during the latter step, please mail to this list to let us know. Any symptoms and speculations are of course welcome. :) What I know: I've tested this on two Debian Unstable linux machines as well as Red Hat 7.x box, with various beta versions of Zope 2.5, and various versions of Python 2.1 (hand-compiled, with Debian, with Zope binary version, latest CVS (now 2.1.2), etc). In all these circumstances, I've seen the following behavior: * crashes occur straight away; I open a single node and then do anything else in Zope, and Zope crashes (I see a Zope restart) * once I set ZOPE_SECURITY_POLICY to PYTHON ("export ZOPE_SECURITY_POLICY=PYTHON" in my shell) the crashes disappear. * the crashes don't occur when the DOM is accessed without Zope security policy anyway (just Python, such as from an external method or Python product) This seems to hint at a problem with the new cAccessControl in Zope 2.5, as during the DOM tree access only exercises Python code (not even the Expat parser in ParsedXML). Unfortunately I can't get the ZC guys to replicate my results; it works for them (platform is still forthcoming). So I'm asking for your help in replicating these crashes (or alternatively so you can point out to me what I'm doing wrong..) and in finding out more information. It could after all point at a serious crashbug in Zope 2.5, and of course I'd just like ParsedXML to work with it! Please help! Regards, Martijn From cnd at ecn.purdue.edu Thu Jan 17 11:54:54 2002 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Help test ParsedXML on Zope 2.5 References: <20020117113652.GA24462@vet.uu.nl> Message-ID: <3C4701DE.787DAC17@ecn.purdue.edu> Martijn, Are you trying this with a brand new database or are you using an old one? I will try both here in a bit. Building the cvs ParsedXML stuff now. Question: What's the difference between the expat that comes with the Python distribution and the one in ParsedXML? -Chris Martijn Faassen wrote: > > Hi there, > > Since the first Zope 2.5 betas have been coming out I've been testing > ParsedXML with it. Unfortunately on the platforms I've tested it on > I've seen some bad crashing behavior. Since they don't see this > behavior at Zope corporation, I'd like to get some other people to test > this, so we can track down the problem. > > Your help will be greatly appreciated! > > What you need to do: > > * be on a unix box, or be on windows with a compiler, as you still need to > compile ParsedXML's Expat extension > > * download and install the latest Zope 2.5 beta, currently: > > http://www.zope.org/Products/Zope/2.5.0b4/ > > * download and install a ParsedXML tarball from CVS > > http://cvs.zope.org/Products/ParsedXML/ParsedXML.tar.gz?tarball=1 > > * compile the Expat extension. With the Python you use for Zope, > in the Products/ParsedXML/Expat directory, do: > > python setup.py > > * now load a largish XML document into a ParsedXML document in this Zope. > I myself have been using timon.xml, which can be found here: > > http://collector.zope.org/Zope/83/timon.xml > > * now go to the DOM tree view, and try to open nodes in the tree > (and subnodes, etc). > > If Zope crashes during the latter step, please mail to this list to > let us know. Any symptoms and speculations are of course welcome. :) > > What I know: > > I've tested this on two Debian Unstable linux machines as well as Red Hat 7.x > box, with various beta versions of Zope 2.5, and various versions of > Python 2.1 (hand-compiled, with Debian, with Zope binary version, > latest CVS (now 2.1.2), etc). In all these circumstances, I've seen > the following behavior: > > * crashes occur straight away; I open a single node and then do anything > else in Zope, and Zope crashes (I see a Zope restart) > > * once I set ZOPE_SECURITY_POLICY to PYTHON > ("export ZOPE_SECURITY_POLICY=PYTHON" in my shell) the crashes > disappear. > > * the crashes don't occur when the DOM is accessed without Zope security > policy anyway (just Python, such as from an external method or Python > product) > > This seems to hint at a problem with the new cAccessControl in Zope 2.5, > as during the DOM tree access only exercises Python code (not even the > Expat parser in ParsedXML). > > Unfortunately I can't get the ZC guys to replicate my results; it works > for them (platform is still forthcoming). So I'm asking for your help in > replicating these crashes (or alternatively so you can point out to > me what I'm doing wrong..) and in finding out more information. > It could after all point at a serious crashbug in Zope 2.5, and of course > I'd just like ParsedXML to work with it! > > Please help! > > Regards, > > Martijn > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml -- -------------------------------------------------------------------- Christopher N. Deckard | Lead Web Systems Developer cnd@ecn.purdue.edu | Engineering Computer Network http://www.ecn.purdue.edu/ | Purdue University ---- zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') --- From faassen at vet.uu.nl Thu Jan 17 14:41:55 2002 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Help test ParsedXML on Zope 2.5 In-Reply-To: <3C4701DE.787DAC17@ecn.purdue.edu> References: <20020117113652.GA24462@vet.uu.nl> <3C4701DE.787DAC17@ecn.purdue.edu> Message-ID: <20020117194155.GA26923@vet.uu.nl> Christopher N. Deckard wrote: > Are you trying this with a brand new database or are you using an > old one? I will try both here in a bit. Building the cvs ParsedXML > stuff now. I've tried it with new ZODBs, and definitely new documents. > Question: What's the difference between the expat that comes with > the Python distribution and the one in ParsedXML? I suspect it depends on the python distribution, but last I checked the pyexpat that came with the Python distribution was not recent enough. There's I believe also a version coming with PyXML which should be recent enough, I think. And to confuse things further, binary installs of Zope 2.5.0b3 (I think) and later also have a newer pyexpat included with their Python (though Zope itself also includes a very old PyExpat..). At least I've been told. Um, yeah, the pyexpat picture is unnecessarily complicated, but I'm not quite sure how to start tackling it. :) Regards, Martijn From cnd at ecn.purdue.edu Thu Jan 17 16:32:01 2002 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Help test ParsedXML on Zope 2.5 References: <20020117113652.GA24462@vet.uu.nl> Message-ID: <3C4742D1.D8712EF1@ecn.purdue.edu> Ok. I've got some interesting results... (kinda long...) Software: Debian Unstable, kernel 2.4.16 SMP Hand compiled Python 2.1.2 Hand compiled Zope 2.5b4 ParsedXML from CVS, following the directions that Martijn provided Some other products, etc. Case 1) I started Zope with a clean database, grabbed the timon.xml document and uploaded it _with_ namespaces. I get the same results as Martijn. Open a node (sometimes two) and then nothing else in Zope works and I get a restart. Case 2) Started Zope with a clean database, used my XML document. Uploaded _with namespaces_, get the Zope crash/restart problem after a couple nodes. Case 3) Started Zope with a clean database, used my XML document. Uploaded _with out namespaces_, get the Zope crash/restart problem after a couple nodes. Case 4) I started Zope with my old database which had an existing ParsedXML object. I had _NO_ problems doing the node drop down thing. Everything worked fine. Case 5) Same Zope with old database. I uploaded the my XML document _with namespaces_. The problems with Zope crashing/restarting occured, like those with the timon.xml document. Case 6) Same Zope with old database. Uploaded my XML document _without namespaces_. Same Zope crash/restart problems occured after dropping on the third time dropping nodes. Case 7) Attempted to copy the original object to see if that made a difference. After waiting for about 5 minutes, I gave up stopped the web browser. Zope kept trying to do something, and was still responsive, but I think that transaction is hung. Python is using 100% of one of the CPUs. I want to do some other tests, so I'm going to kill it. You can grab my XML document at the following URL: http://eng.purdue.edu/people/cnd/zope/ParsedXML/xml_documents/ It's my first jump into XML, so if anyone has any constructive criticism I'd be happy to hear it. :-) I don't have time yet today to try and jump in and try and figure out what's going on. Oh yeah, and it seems like all the crash problems went away with the "ZOPE_SECURITY_POLICY=PYTHON" thing. What exactly does _that_ do??? Is it opening a security vulnerability somewhere? After I fix some of my code which uses the ParsedXML stuff, I'll test it. I hope some of this helps. Let me know if you want me to try anything specific. -Chris Martijn Faassen wrote: > > Hi there, > > Since the first Zope 2.5 betas have been coming out I've been testing > ParsedXML with it. Unfortunately on the platforms I've tested it on > I've seen some bad crashing behavior. Since they don't see this > behavior at Zope corporation, I'd like to get some other people to test > this, so we can track down the problem. > > Your help will be greatly appreciated! > > What you need to do: > > * be on a unix box, or be on windows with a compiler, as you still need to > compile ParsedXML's Expat extension > > * download and install the latest Zope 2.5 beta, currently: > > http://www.zope.org/Products/Zope/2.5.0b4/ > > * download and install a ParsedXML tarball from CVS > > http://cvs.zope.org/Products/ParsedXML/ParsedXML.tar.gz?tarball=1 > > * compile the Expat extension. With the Python you use for Zope, > in the Products/ParsedXML/Expat directory, do: > > python setup.py > > * now load a largish XML document into a ParsedXML document in this Zope. > I myself have been using timon.xml, which can be found here: > > http://collector.zope.org/Zope/83/timon.xml > > * now go to the DOM tree view, and try to open nodes in the tree > (and subnodes, etc). > > If Zope crashes during the latter step, please mail to this list to > let us know. Any symptoms and speculations are of course welcome. :) > > What I know: > > I've tested this on two Debian Unstable linux machines as well as Red Hat 7.x > box, with various beta versions of Zope 2.5, and various versions of > Python 2.1 (hand-compiled, with Debian, with Zope binary version, > latest CVS (now 2.1.2), etc). In all these circumstances, I've seen > the following behavior: > > * crashes occur straight away; I open a single node and then do anything > else in Zope, and Zope crashes (I see a Zope restart) > > * once I set ZOPE_SECURITY_POLICY to PYTHON > ("export ZOPE_SECURITY_POLICY=PYTHON" in my shell) the crashes > disappear. > > * the crashes don't occur when the DOM is accessed without Zope security > policy anyway (just Python, such as from an external method or Python > product) > > This seems to hint at a problem with the new cAccessControl in Zope 2.5, > as during the DOM tree access only exercises Python code (not even the > Expat parser in ParsedXML). > > Unfortunately I can't get the ZC guys to replicate my results; it works > for them (platform is still forthcoming). So I'm asking for your help in > replicating these crashes (or alternatively so you can point out to > me what I'm doing wrong..) and in finding out more information. > It could after all point at a serious crashbug in Zope 2.5, and of course > I'd just like ParsedXML to work with it! > > Please help! > > Regards, > > Martijn > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml -- -------------------------------------------------------------------- Christopher N. Deckard | Lead Web Systems Developer cnd@ecn.purdue.edu | Engineering Computer Network http://www.ecn.purdue.edu/ | Purdue University ---- zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') --- From faassen at vet.uu.nl Thu Jan 17 17:23:01 2002 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Help test ParsedXML on Zope 2.5 In-Reply-To: <3C4742D1.D8712EF1@ecn.purdue.edu> References: <20020117113652.GA24462@vet.uu.nl> <3C4742D1.D8712EF1@ecn.purdue.edu> Message-ID: <20020117222301.GA27810@vet.uu.nl> Christopher N. Deckard wrote: > Ok. I've got some interesting results... (kinda long...) Thanks, this second data point is *very* useful! Thanks for all the testing! [snip] > Case 4) > I started Zope with my old database which had an existing ParsedXML > object. I had _NO_ problems doing the node drop down thing. > Everything worked fine. This is an interesting case! What version of ParsedXML were you using before, and what version of Zope? [snip] The other cases are similar to what happens to me.. > Case 7) > Attempted to copy the original object to see if that made a > difference. After waiting for about 5 minutes, I gave up stopped > the web browser. Zope kept trying to do something, and was still > responsive, but I think that transaction is hung. Python is using > 100% of one of the CPUs. I want to do some other tests, so I'm > going to kill it. Hm, I had some copying issues today, but they involved a group of objects so I didn't suspect ParsedXML. I should do some more testing with copying objects. Could you copy non-original ParsedXML objects? Copying seems to work for me, though it does seem to take a while. > You can grab my XML document at the following URL: > > http://eng.purdue.edu/people/cnd/zope/ParsedXML/xml_documents/ > > It's my first jump into XML, so if anyone has any constructive > criticism I'd be happy to hear it. :-) No criticism; very useful data! > I don't have time yet today to try and jump in and try and figure > out what's going on. Oh yeah, and it seems like all the crash > problems went away with the "ZOPE_SECURITY_POLICY=PYTHON" thing. > What exactly does _that_ do??? Is it opening a security > vulnerability somewhere? No, Zope 2.5 features some optimizations of the security machinery; some of the stuff that was written in Python now has been rewritten to C for speed. Setting that environment variable makes Zope use the old Python based security infrastructure again. This makes me strongly suspect the new optimized security infrastructure is somehow involved. I'm not sure how to understand the situation with your old document working, however. That is pretty bizarre.. Thank you again, Martijn From cnd at ecn.purdue.edu Thu Jan 17 17:42:58 2002 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Help test ParsedXML on Zope 2.5 References: <20020117113652.GA24462@vet.uu.nl> <3C4742D1.D8712EF1@ecn.purdue.edu> <20020117222301.GA27810@vet.uu.nl> Message-ID: <3C475372.D2E17BF@ecn.purdue.edu> Martijn Faassen wrote: > Thanks, this second data point is *very* useful! Thanks for all > the testing! No prob. I want to see XML succeed on Zope. > [snip] > > Case 4) > > I started Zope with my old database which had an existing ParsedXML > > object. I had _NO_ problems doing the node drop down thing. > > Everything worked fine. > > This is an interesting case! What version of ParsedXML were you > using before, and what version of Zope? Zope 2.4.3 and ParsedXML 1.2.1. It was exported from 2.4.3 and imported into a 2.5b3. The 2.5b3 database was "fixed" per some instructions on the Zope-dev mailing list so that it would open in 2.5b4. > [snip] > > The other cases are similar to what happens to me.. > > > Case 7) > > Attempted to copy the original object to see if that made a > > difference. After waiting for about 5 minutes, I gave up stopped > > the web browser. Zope kept trying to do something, and was still > > responsive, but I think that transaction is hung. Python is using > > 100% of one of the CPUs. I want to do some other tests, so I'm > > going to kill it. > > Hm, I had some copying issues today, but they involved a group of > objects so I didn't suspect ParsedXML. I should do some more testing > with copying objects. Could you copy non-original ParsedXML objects? > Copying seems to work for me, though it does seem to take a while. Pasting of a Python Script was very quick. Maybe I'll try a ParsedXML later tonight. > > I don't have time yet today to try and jump in and try and figure > > out what's going on. Oh yeah, and it seems like all the crash > > problems went away with the "ZOPE_SECURITY_POLICY=PYTHON" thing. > > What exactly does _that_ do??? Is it opening a security > > vulnerability somewhere? > > No, Zope 2.5 features some optimizations of the security machinery; some > of the stuff that was written in Python now has been rewritten to C > for speed. Setting that environment variable makes Zope use the old > Python based security infrastructure again. This makes me strongly > suspect the new optimized security infrastructure is somehow involved. > I'm not sure how to understand the situation with your old document > working, however. That is pretty bizarre.. Well, good info to know. Thanks for the explanation. Last thing to note... I made changes to my pre-existing ParsedXML document through the ZMI. I didn't have any crash problems even after the changes. I thought that was kinda strange... -Chris -- -------------------------------------------------------------------- Christopher N. Deckard | Lead Web Systems Developer cnd@ecn.purdue.edu | Engineering Computer Network http://www.ecn.purdue.edu/ | Purdue University ---- zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') --- From noah at tahajo.com Mon Jan 21 20:28:34 2002 From: noah at tahajo.com (Noah Friedland) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Looking for command-line import of xml/zexp trees into zope Message-ID: All: I'm looking for a command-line method of importing xml/zexp trees into zope (an equivalent of the import/export mechanism employed with the web interface that taps the OFS.ObjectManager). Please send responses to my email acct as well. Thanks! --Noah From cnd at ecn.purdue.edu Wed Jan 23 13:46:45 2002 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] wandering the tree questions Message-ID: <3C4F0515.398CF632@ecn.purdue.edu> I have an XML document here: http://eng.purdue.edu/people/cnd/zope/ParsedXML/xml_documents/usgs_cru_xml I am using this for a template system. Basically, you define a template in the XML document, and then I use it to dynamically build a HTML form. It's got other meta-data for noting that something is required or has to be a certain type etc. I don't store my data in XML, I store it in a zope Folder and the properties of a folder hold the value for each part of the data I need to collect. I thought that I would be all fancy with this and make it so that I don't have to write lots of XML just to define properties. I made it so that I could define a property that has sub properties. This has pretty much infinite nesting, but actually Zope will kick in and say that there was too much recursion. Basically I want to generate a list of properties something like this: where: p = property sp = sub property ssp = sub property of sub property properties: p1.sp1 p2.sp1 p3.sp1.ssp1 p3.sp2.ssp1 So something like that. The whole p.sp.ssp thing is the name of the property that gets created as a property of a folder. If you look at the XML (in the templates section) you'll notice that it's kinda like this The way I get the p.sp.spp stuff is through a recursive python script. I originally go to a "version" node, and then did for version.childNodes and looked for "properties", then did childNodes on that and looked for "property" nodes. If "property" node had an attribute called "type" equal to "parent", then it would call the same method on that "property" node... recursively. All of this was very quick when this resided on a ZEO cluster. We moved it from a ZEO setup to a straight Zope setup, and now it's extremely slow. In looking at my code, and looking at what i'm iterating over, I keep looking at the same nodes over and over again. So I rewrote it to use getElementsByTagName. This seems to be a little faster, but that method seems to get everything under a node with an element of that name. So if I am on the first "properties" node (above) and do a getElementsByTagName('property'), I get back every single element, including things that are child nodes of other things. This makes what I'm trying to do pointless as I don't know which is a sub "property" of a "property". I hope this is making sense. It doesn't seem to as I type it. :-) Does anyone have a suggestion on the best way to generate my list of properties? Or should I just forget the nesting and basically hard code them? -Chris -- -------------------------------------------------------------------- Christopher N. Deckard | Lead Web Systems Developer cnd@ecn.purdue.edu | Engineering Computer Network http://www.ecn.purdue.edu/ | Purdue University ---- zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') --- From wittern at kanji.zinbun.kyoto-u.ac.jp Wed Jan 30 22:44:23 2002 From: wittern at kanji.zinbun.kyoto-u.ac.jp (Christian Wittern) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ParsedXML and Zope 2.5.0 Message-ID: Hi there, I also have problems with the above mentioned combinations. The following script(Python) brings the server down and forces a restart reliably:-( It seem not to depend on the document (except that it only works for 'topic' elements) , but if you need a test document, I will provide one. here goes the script: ---- root = context.documentElement kids = root.getElementsByTagName('topic') #print len(kids) for kid in kids: print kid.nodeName ---- the print len(kids) alone seems to work. Hope this helps in finding the offending lines. All the best, Christian -- Christian Wittern Institute for Research in Humanities, Kyoto University 47 Higashiogura-cho, Kitashirakawa, Sakyo-ku, Kyoto 606-8265, JAPAN