From wilson at visi.com Sun Dec 2 19:31:48 2001 From: wilson at visi.com (Timothy Wilson) Date: Sun Aug 10 16:54:50 2008 Subject: [Zope-xml] I've got ParsedXML...now what? Message-ID: Hi everyone, I've just subscribed to the list and I'm hoping to get some basic starter info about using ParsedXML or any other XML tool in Zope. I want to build a simple tool that our school's librarians can use to publish useful links for teachers and their students' projects. For example, a science teacher may want to publish a collection of earthworm-related links for a research paper her students are writing. I've installed ParsedXML and I've uploaded a bookmarks file in XBEL format to Zope. Now I need to know how to display them. I've searched Zope.org looking for relevant How-Tos, but I came up empty. Can anyone provide any tips or suggest some reading that would give me some insight? Any example code would be appreciated. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From cnd at ecn.purdue.edu Sun Dec 2 22:45:21 2001 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:50 2008 Subject: [Zope-xml] I've got ParsedXML...now what? In-Reply-To: References: Message-ID: <1007351127.5388.0.camel@moonchild> Really, in my experience, all of the power of ParsedXML comes from using the DOM interfaces. The DOM specification is available from the W3C (www.w3c.org). If you follow the interfaces, you will figure out how to get around using the DOM. Another good place to start is by looking at the example DTML that comes with the ParsedXML product. Import it and start playing/learning. It was my experience that it is a very steep learning curve to figure out how to use ParsedXML. I still don't think I'm doing it right, but it works. :-) Start simple and build off of it. You have a good XML example to start from, with your bookmarks. Just take it slow and make it do what you want. Good luck, and if you have questions about exactly where to start, I may be able to tell you where I began. Try the w3c first though. -Chris On Sun, 2001-12-02 at 19:31, Timothy Wilson wrote: > Hi everyone, > > I've just subscribed to the list and I'm hoping to get some basic starter > info about using ParsedXML or any other XML tool in Zope. > > I want to build a simple tool that our school's librarians can use to > publish useful links for teachers and their students' projects. For example, > a science teacher may want to publish a collection of earthworm-related > links for a research paper her students are writing. > > I've installed ParsedXML and I've uploaded a bookmarks file in XBEL format > to Zope. Now I need to know how to display them. I've searched Zope.org > looking for relevant How-Tos, but I came up empty. > > Can anyone provide any tips or suggest some reading that would give me some > insight? Any example code would be appreciated. > > -Tim > > -- > Tim Wilson | Visit Sibley online: | Check out: > Henry Sibley HS | http://www.isd197.org | http://www.zope.com > W. St. Paul, MN | | http://slashdot.org > wilson@visi.com | | http://linux.com > > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml From faassen at vet.uu.nl Tue Dec 4 15:30:12 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:50 2008 Subject: [Zope-xml] install problem In-Reply-To: <200111281425.fASEPke11926@eda.hyperwerk.ch> References: <200111281425.fASEPke11926@eda.hyperwerk.ch> Message-ID: <20011204213012.A12075@vet.uu.nl> igor brodnik wrote: > described location) before the script executes the make command I get the > following lines... > > :it doesn't find Setup.thread > : too many arguments to function 'PyFrame_New' > make[1]: Leaving directory > `/usr/local/zope/Zope-2.4.3-src/lib/python/Products/ParsedXML/Expat' > gcc -fPIC -D_FILE_OFFSET_BITS=64 -DHAVE_LARGEFILE_SUPPORT -O2 -mcpu=i486 > -ma rch=i486 -I/usr/include/python2.1 -I/usr/include/python2.1 > -DHAVE_CONFIG_H -DHAVE_EXPAT_H -Ilib -c ././pyexpat.c -o ./pyexpat.o > ././pyexpat.c: In function `call_with_frame': > ././pyexpat.c:365: too many arguments to function `PyFrame_New' > make: *** [pyexpat.o] Error 1 > > I'd appreciate any help I'm just guessing wildly, but is it possible your version of Python is not compiled to use threads? Regards, Martijn From faassen at vet.uu.nl Thu Dec 6 11:23:32 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] update Message-ID: <20011206172332.A19251@vet.uu.nl> Hey there, Some progress: * I hooked my NodePath implementation into ParsedXML. Currently only ChildId paths (path to node using child node indexes) and RobustPaths (paths to nodes using heuristics to be more resilient to changes to the structure of the document) are supported. I'm working on using Element Ids (see next entry) as well, and it shouldn't be hard to plug in other schemes. The urls do look pretty funky, though, but it was the only solid way I could integrate them with Zope that I've found. * I've finished up implementing element_ids for ParsedXML's core DOM. It also works for cloneNode and importNode now. I know this (reasonably certain) because I implemented a unit test suite for element ids. :) Next step is to merge both changes into the ParsedXML trunk, which are both sitting in separate branches right now. Unless someone objects to them. The branches are: faasen-parsedxml_node_id-branch (for element ids) faassen-parsedxml-nodepath-branch (the node path framework) Regards, Martijn From mj at zope.com Thu Dec 6 11:50:01 2001 From: mj at zope.com (Martijn Pieters) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Re: [Parsed-XML-Dev] update In-Reply-To: <20011206172332.A19251@vet.uu.nl> References: <20011206172332.A19251@vet.uu.nl> Message-ID: <20011206164959.GQ23613@zope.com> On Thu, Dec 06, 2001 at 05:23:32PM +0100, Martijn Faassen wrote: > Next step is to merge both changes into the ParsedXML trunk, which are > both sitting in separate branches right now. Unless someone objects to them. Please go right ahead and merge these; they look good to me. -- Martijn Pieters | Software Engineer mailto:mj@zope.com | Zope Corporation http://www.zope.com/ | Creators of Zope http://www.zope.org/ --------------------------------------------- From faassen at vet.uu.nl Thu Dec 6 13:33:07 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Re: [Parsed-XML-Dev] update In-Reply-To: <20011206164959.GQ23613@zope.com> References: <20011206172332.A19251@vet.uu.nl> <20011206164959.GQ23613@zope.com> Message-ID: <20011206193307.A19847@vet.uu.nl> Martijn Pieters wrote: > On Thu, Dec 06, 2001 at 05:23:32PM +0100, Martijn Faassen wrote: > > Next step is to merge both changes into the ParsedXML trunk, which are > > both sitting in separate branches right now. Unless someone objects to them. > Please go right ahead and merge these; they look good to me. Excellent, thanks! Regards, Martijn From cnd at ecn.purdue.edu Fri Dec 7 12:47:45 2001 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ParsedXML and Zope 2.5 Message-ID: <3C1100C1.EB235DFF@ecn.purdue.edu> I was wondering if I could get a heads up on any problems with ParsedXML and the to be Zope 2.5? We normally jump on new Zope versions right away, but I'm using the ParsedXML stuff extensively now and I don't want things to break. Thanks, -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 faassen at vet.uu.nl Fri Dec 7 14:11:43 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ParsedXML and Zope 2.5 In-Reply-To: <3C1100C1.EB235DFF@ecn.purdue.edu> References: <3C1100C1.EB235DFF@ecn.purdue.edu> Message-ID: <20011207201143.A24894@vet.uu.nl> Christopher N. Deckard wrote: > I was wondering if I could get a heads up on any problems with > ParsedXML and the to be Zope 2.5? We normally jump on new Zope > versions right away, but I'm using the ParsedXML stuff extensively > now and I don't want things to break. I haven't tried it yet. I can't think of anything that would break, as the Python version is the same as for Zope 2.4, but best way would be to try it out. Let me know if there are any problems. Eventually I'll get to running its unit tests in Zope 2.5 myself. Not that the failing of unit tests necessarily indicates bad trouble; far too many are failing now... I'm still hoping on a clue on why the parser unit tests crash under some circumstances. Regards, Martijn From wilson at visi.com Fri Dec 7 16:33:39 2001 From: wilson at visi.com (Timothy Wilson) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] working with XBEL Message-ID: Hi everyone, I'm interesting in learning to manipulate XML with Python. Eventually I'd like to build a Zope app for manipulating and publishing bookmarks (probably using the ParsedXML product at this point). I've got a Debian Linux system here with all the python-related XML packages installed. I also read the Python/XML HOWTO (Release 0.6.1, March 20, 2001) and Fred Drake's description of XBEL. I'm having trouble getting the simplest little script to work. It seems like there are many different modules to use and I'm not having any luck even importing them. wilsont@galileo:~$ python Python 2.1.1 (#1, Nov 11 2001, 18:19:24) [GCC 2.95.4 20011006 (Debian prerelease)] on linux2 Type "copyright", "credits" or "license" for more information. >>> from xml.dom.ext.reader.Sax import FromXmlFile Traceback (most recent call last): File "", line 1, in ? ImportError: No module named ext.reader.Sax >>> At this point, I'd like to find a very simple piece of code that will load a tiny little XBEL-formatted bookmark file and create a DOM tree. Any pointers? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From faassen at vet.uu.nl Fri Dec 7 18:54:23 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] working with XBEL In-Reply-To: References: Message-ID: <20011208005423.A26088@vet.uu.nl> Timothy Wilson wrote: > At this point, I'd like to find a very simple piece of code that will load a > tiny little XBEL-formatted bookmark file and create a DOM tree. Well, ParsedXML can do that, even without Python XML. You can do this in Zope (easily, create a ParsedXML object), or from the commandline. There are some examples on what to do in the unit test directory. I'll also post an example: from Products.ParsedXML.DOM import ExpatBuilder file = open('myxbelfile', 'r') doc = ExpatBuilder.parse(file) file.close() This takes a file-like object and builds a ParsedXML DOM tree from it using Expat. 'doc' now should refer to the document node, so you can do stuff like this: doc.documentElement.appendChild(doc.createElement('foo')) to add a 'foo' element to the end of the list of child nodes. Regards, Martijn From willem at pastelhorn.com Fri Dec 7 21:56:42 2001 From: willem at pastelhorn.com (Willem Broekema) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ZPT + ParsedXML strangeness (acquisition vs. getattr) Message-ID: <3C11816A.8030805@pastelhorn.com> Hi -- here's a strange behaviour using Page Templates and ParsedXML. The files (also in wilm.nl/test with u/p faassen:faassen): --- xml : ParsedXML --------------------------------------------- a elm 1 --- pt_een : ZPT -------------------------------------------------
a/pt_twee
--- pt_twee : ZPT ------------------------------------------------ something ------------------------------------------------------------------ Calling: xml/pt_een results in: if I'm logged in as 'manager': "something" # this is correct if I'm not logged in: "Error Type: TALESError Error Value: exceptions.ValueError on invalid literal for int(): pt_twee in "" Now, creating a "Script (Python)" with proxy 'manager': --- py : Script (Python) ----------------------------------------- return context.xml.pt_een() ------------------------------------------------------------------ and calling that gives the same exception, which is strange, as as manager it's ok. Changing the line in ZPT pt_een from:
a/pt_twee
to:
a/pt_twee
results in: Error Type: TALESError Error Value: exceptions.AttributeError on pt_twee in So, what Martijn Faassen concluded (thanks for looking into it!): - when logged in as manager, Zope (correctly!) applies the acquired ZPT 'pt_twee' to the XML node; - when not, even with a proxy role, Zope (incorrectly!) tries to fetch the 'pt_twee' *index* of the XML node - getitem(a, 'pt_twee'); probably because of some security issue(?) Could someone explain this, or confirm this is a bug? Again, all files are accessible on my site mentioned above, in case you want to see the full traceback etc. - Willem From wilson at visi.com Sat Dec 8 15:44:05 2001 From: wilson at visi.com (Timothy Wilson) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] working with XBEL In-Reply-To: <20011208005423.A26088@vet.uu.nl> Message-ID: On Sat, 8 Dec 2001, Martijn Faassen wrote: > Timothy Wilson wrote: > > At this point, I'd like to find a very simple piece of code that will load a > > tiny little XBEL-formatted bookmark file and create a DOM tree. > > Well, ParsedXML can do that, even without Python XML. You can do this > in Zope (easily, create a ParsedXML object), or from the commandline. > There are some examples on what to do in the unit test directory. I'll > also post an example: Thanks Martijn. I hadn't considered using ParsedXML itself apart from Zope. I'll mess with that a bit. Are there any other little sample programs anywhere that use XBEL and the DOM? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From dethe at burningtiger.com Sat Dec 8 17:43:40 2001 From: dethe at burningtiger.com (Dethe Elza) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] working with XBEL References: Message-ID: <3C12979C.5040907@burningtiger.com> Hi Tim, You may need to use the python which came with your Zope, and add [pathToZope]/lib/python/ to your python path. Then you should be able to use most anything which works from Zope in your Python programs. HTH --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From faassen at vet.uu.nl Sat Dec 8 19:15:51 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] working with XBEL In-Reply-To: References: <20011208005423.A26088@vet.uu.nl> Message-ID: <20011209011551.A29114@vet.uu.nl> Timothy Wilson wrote: > On Sat, 8 Dec 2001, Martijn Faassen wrote: > > > Timothy Wilson wrote: > > > At this point, I'd like to find a very simple piece of code that will load a > > > tiny little XBEL-formatted bookmark file and create a DOM tree. > > > > Well, ParsedXML can do that, even without Python XML. You can do this > > in Zope (easily, create a ParsedXML object), or from the commandline. > > There are some examples on what to do in the unit test directory. I'll > > also post an example: > > Thanks Martijn. I hadn't considered using ParsedXML itself apart from > Zope. I'll mess with that a bit. Are there any other little sample programs > anywhere that use XBEL and the DOM? Using it completely apart from Zope would be more difficult, as you have some Zope dependencies (such as acquisition). But you're asking on Zope-XML so I gave you a Zopeish answer. :) Regards, Martijn From jesper.holmberg at enst-bretagne.fr Sun Dec 9 11:13:00 2001 From: jesper.holmberg at enst-bretagne.fr (Jesper Holmberg) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] DOM and Zope Message-ID: <20011209161300.GB410@strindberg.maisel.enst-bretagne.fr> I am not totally sure about the focus of this group. I apologize in advance if this subject is inappropriate. As for the subject: This code works fine in the python (2.1.1) interpreter: from xml.dom import minidom myDoc = minidom.Document() myEl = myDoc.createElement('jeppe') myEl2 = myDoc.createElement('henning') myDoc.appendChild(myEl) myDoc.insertBefore(myEl2, myEl) print myEl2.parentNode print myEl2.nextSibling However, when I put this code in a Zope (2.4.2) product, and run it, I get an error on the last line: Error Type: AttributeError Error Value: nextSibling with trace ending in: File /usr/lib/zope/lib/python/xml/dom/minidom.py, line 74, in __getattr__ AttributeError: (see above) So for some reason, the node myEl2 is not correctly inserted in the DOM. It knows its parent, but not who is it's sibling. In fact, if nextSibling were None, there wouldn't be an error, but now it doesn't even know it has an attribute with this name. Does anyone have an idea what could be the problem? TIA, Jesper -- Jesper Holmberg |"But how can | jesper.holmberg@enst-bretagne.fr | one be warm | ENST Br, BP 832, 29285 Brest, FRANCE | alone?" | From faassen at vet.uu.nl Sun Dec 9 13:06:33 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] DOM and Zope In-Reply-To: <20011209161300.GB410@strindberg.maisel.enst-bretagne.fr> References: <20011209161300.GB410@strindberg.maisel.enst-bretagne.fr> Message-ID: <20011209190633.A31577@vet.uu.nl> Jesper Holmberg wrote: > I am not totally sure about the focus of this group. I apologize in > advance if this subject is inappropriate. Anything about using XML in Zope is appropriate in my opinion. :) > As for the subject: > > This code works fine in the python (2.1.1) interpreter: > > from xml.dom import minidom > > myDoc = minidom.Document() > myEl = myDoc.createElement('jeppe') > myEl2 = myDoc.createElement('henning') > myDoc.appendChild(myEl) > myDoc.insertBefore(myEl2, myEl) > print myEl2.parentNode > print myEl2.nextSibling This is the same interpreter as the one you use to run Zope? > However, when I put this code in a Zope (2.4.2) product, and run it, I get an > error on the last line: > > Error Type: AttributeError > Error Value: nextSibling > > with trace ending in: > > File /usr/lib/zope/lib/python/xml/dom/minidom.py, line 74, in __getattr__ > AttributeError: (see above) I haven't used minidom, but if your Zope's Python is a different one than the one you use on the commandline, it is possible the minidom in the Zope install is perhaps an older version not yet supporting nextSibling? > So for some reason, the node myEl2 is not correctly inserted in the DOM. > It knows its parent, but not who is it's sibling. In fact, if nextSibling > were None, there wouldn't be an error, but now it doesn't even know it has > an attribute with this name. > > Does anyone have an idea what could be the problem? Well, if it isn't that you're using a different version of minidom in Zope I'm utterly clueless and it'd be a very weird problem; Python code inside Zope ought to work exactly the same as Python code outside Zope.. Regards, Martijn From jesper.holmberg at enst-bretagne.fr Sun Dec 9 14:54:37 2001 From: jesper.holmberg at enst-bretagne.fr (Jesper Holmberg) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] DOM and Zope In-Reply-To: <20011209190633.A31577@vet.uu.nl> References: <20011209161300.GB410@strindberg.maisel.enst-bretagne.fr> <20011209190633.A31577@vet.uu.nl> Message-ID: <20011209195437.GM410@strindberg.maisel.enst-bretagne.fr> * On Sun Dec 09, Martijn Faassen wrote: > I haven't used minidom, but if your Zope's Python is a different one than > the one you use on the commandline, it is possible the minidom in the > Zope install is perhaps an older version not yet supporting nextSibling? Ah, Martijn. I you were here I'd kiss your feet. This was indeed the problem. The Python interpreter and Zope run the same code, but I had forgotten to copy the minidom.py from the new Python version, and thus I was running the older Python code without realizing it. Thank you! This has been the most annoying bug I've experiencing in a long while. Jesper -- Jesper Holmberg |"But how can | jesper.holmberg@enst-bretagne.fr | one be warm | ENST Br, BP 832, 29285 Brest, FRANCE | alone?" | From faassen at vet.uu.nl Mon Dec 10 10:55:43 2001 From: faassen at vet.uu.nl (Martijn Faassen) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] status update Message-ID: <20011210165543.A2640@vet.uu.nl> Hi there, NodePaths is now in ParsedXML CVS. I hope to do a new development release of ParsedXML this week. NodePaths include: * new way to address nodes in documents using a special (funky looking) URL element like this: /child,0,3,4 * Currently three ways to address nodes: 'child' (using child index), 'element_id' (using unique element ids for elements, childs for the rest), and 'robust' (using heuristics) * Every element has a unique 'elementId' attribute. While this is guaranteed to be available and is always unique, particular element_ids will likely change each time you change a document and reparse it. (though not if you add nodes through the DOM, so it's more robust to changes than child indexes) I've also made some progress on XMLWidgets, and I want to do a release of it (in raw development form) soon as well. XMLWidgets allow you to attach methods to XML nodes based on what the node is or which node it is. So, I can say 'all p nodes get this 'render' method, but all 'chapter' nodes get this other 'render' method. This allows you to construct simple fairly declarative renders of XML documents using the DOM. It also allows you to construct more fancy things like authoring tools. XMLWidgets plugs into the NodePath system of ParsedXML with its own form of node paths, called 'widget'. They are very similar to element_id paths, with the difference that the object that will be returned won't a be manageable node (node with manageable wrapper), but instead a node with a widget wrapper (adding the methods to the node depending on the association). Think of this as a preview of some of the things Zope3 will be able to do, though it'll likely be called entirely different things and work differently. But conceptually there's some overlap. :) Regards, Martijn From mj at zope.com Mon Dec 10 17:21:36 2001 From: mj at zope.com (Martijn Pieters) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] status update In-Reply-To: <20011210165543.A2640@vet.uu.nl> References: <20011210165543.A2640@vet.uu.nl> Message-ID: <20011210222134.GE5310@zope.com> On Mon, Dec 10, 2001 at 04:55:43PM +0100, Martijn Faassen wrote: > Think of this as a preview of some of the things Zope3 will be able to do, > though it'll likely be called entirely different things and work differently. > But conceptually there's some overlap. :) Cool! Looks great Martijn. -- Martijn Pieters | Software Engineer mailto:mj@zope.com | Zope Corporation http://www.zope.com/ | Creators of Zope http://www.zope.org/ --------------------------------------------- From elena.schulz at gmx.net Thu Dec 13 10:05:18 2001 From: elena.schulz at gmx.net (Elena Schulz) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] DOM and Zope Message-ID: <00a601c183e7$ee14a920$07ee32d9@Sebastian> Dear List, is it possible to manipulate and extract node-Content of xml-Files just with the python that comes with zope 2.4.3 as it seems to me when I read Jesper Holmberg?s mail? Is there any documentation about it? Jesper Holmberg wrote: > I am not totally sure about the focus of this group. I apologize in > advance if this subject is inappropriate. Anything about using XML in Zope is appropriate in my opinion. :) > As for the subject: > > This code works fine in the python (2.1.1) interpreter: > > from xml.dom import minidom > > myDoc = minidom.Document() > myEl = myDoc.createElement('jeppe') > myEl2 = myDoc.createElement('henning') > myDoc.appendChild(myEl) > myDoc.insertBefore(myEl2, myEl) > print myEl2.parentNode > print myEl2.nextSibling Thanks for your replies, Elena From elena.schulz at gmx.net Thu Dec 13 10:06:24 2001 From: elena.schulz at gmx.net (Elena Schulz) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Install Problem with parsedXML 1.2.1 Message-ID: <00a701c183e7$efe91b00$07ee32d9@Sebastian> Dear List, I try to install ParsedXML 1.2.1 on win98 with zope 2.3. While building the expat libraries with setup.py as written in the install-read-me I get 2 error-messages 'can?t find file' after 'Building static expat Library' and after 'Building pyexpat extensions ...' Does anybody know how to install it on a win computer? Thanks for your replies, Elena From jesper.holmberg at enst-bretagne.fr Thu Dec 13 11:25:25 2001 From: jesper.holmberg at enst-bretagne.fr (Jesper Holmberg) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] DOM and Zope In-Reply-To: <00a601c183e7$ee14a920$07ee32d9@Sebastian> References: <00a601c183e7$ee14a920$07ee32d9@Sebastian> Message-ID: <20011213162525.GA549@strindberg.maisel.enst-bretagne.fr> * On Thu Dec 13, Elena Schulz wrote: > Dear List, > > is it possible to manipulate and extract node-Content of xml-Files just > with the python that comes with zope 2.4.3 as it seems to me when I read > Jesper Holmberg?s mail? Is there any documentation about it? Hi Elena, I am by no means an expert in this field, and I'm sure you'll have answers more knowledgeable than mine, but as far as my example, I have *not* just used the basic functionality of Zope, but instead I have added necessary Python libraries to my Zope installation to be able to work with XML. Thus my example file starts with line: from xml.dom import minidom where minidom is not part of the standard Zope installation. But as far as I understand it, the ParsedXML is a product which permits you to work with XML under Zope. Jesper -- Jesper Holmberg |"But how can | jesper.holmberg@enst-bretagne.fr | one be warm | ENST Br, BP 832, 29285 Brest, FRANCE | alone?" | From dethe at burningtiger.com Thu Dec 13 12:55:07 2001 From: dethe at burningtiger.com (Dethe Elza) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] DOM and Zope References: <00a601c183e7$ee14a920$07ee32d9@Sebastian> Message-ID: <3C18EB7B.8020803@burningtiger.com> Elena, It is possible to parse and manipulate XML using the standard python that comes with Zope. Recent editions of Zope come with python 2.0, which includes several XML tools. There are more advanced tools that you'll want if you get deeper into XML, but for basic stuff you should be fine with what's built in. Here's a good starting point for the relevant documentation on built-in XML tools in Python 2.0: http://www.python.org/doc/2.0/lib/markup.html The Python XML Howto: http://py-howto.sourceforge.net/xml-howto/xml-howto.html How to write an application using the SAX interface: http://www.hobby.nl/~scaprea/XML/ For further XML support, you'll want to install two libraries: PyXML and 4Suite. I'm afraid I'm not too knowledgeable about installing in windows, as I mainly use Linux and Mac, but they each include installation instructions and pre-compiled binaries are standard for windows, so it should be relatively easy. PyXML (has a windows installer for Python 2.0): http://sourceforge.net/projects/pyxml 4Suite installation instructions: http://www.4suite.org/4Suite.org/documents/howto/4Suite/Windows 4Suite download (assuming you're using python 2.0): ftp://ftp.fourthought.com/pub/4Suite/4Suite-0.11.1.win32-py2.0.exe I hope this helps. If you have further questions, fire away! --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From wilson at visi.com Sun Dec 16 23:14:22 2001 From: wilson at visi.com (Timothy Wilson) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Displaying bookmarks via XBEL Message-ID: Hi everyone, I've been looking into ParsedXML a bit lately, and I wonder if someone more experienced than I would be willing to offer a more specific example to get me started. I feel like I'm really missing the big picture right now and I'm hoping that having an example to work with will help. Also, can anyone recommend some docs on the DOM for someone (me) that knows a bit about XML basics, but am a complete newbie at programming with it. I've got a sample bookmark file posted at http://www.isd197.org/sibley/staff/wilsont/bookmarks.xml (24 kB) and I'd like to render it like this: Actual bookmarks should use the to create a link to the href. Folders should be a link to a new page that display whatever bookmarks are present. I guess it's similar to a tree, but I don't want to use <dtml-tree> I'm having trouble figuring out what names to use to refer to all the nodes, children, etc. The sample code that's included with ParsedXML might help someone with more experience than I, but it hasn't done me much good yet. Any hints (or sample code :-) would be greatly appreciated! -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | <dtml-var pithy_quote> | http://linux.com From dethe at burningtiger.com Mon Dec 17 13:37:15 2001 From: dethe at burningtiger.com (Dethe Elza) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Displaying bookmarks via XBEL References: <Pine.GSO.4.21.0112162200090.10732-100000@isis.visi.com> Message-ID: <3C1E3B5B.3040108@burningtiger.com> Hi Tim, The Python DOM Docs: http://www.python.org/doc/current/lib/module-xml.dom.html I tried to get to your example, but it required a login/password. Unfortunately, most of the XML in Python documentation is focussed on SAX parsing, not DOM manipulations. Here are a couple of starting points, though: Python XML Howto: http://py-howto.sourceforge.net/xml-howto/xml-howto.html Python XML Topic Guide: http://pyxml.sourceforge.net/topics/ Pyton XML Special Interest Group: http://www.python.org/sigs/xml-sig/ If you post your example data and desired results (or a short form of each if they're long %-) I can take a stab at example code. HTH --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From wilson at visi.com Mon Dec 17 15:06:37 2001 From: wilson at visi.com (Timothy Wilson) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Displaying bookmarks via XBEL In-Reply-To: <3C1E3B5B.3040108@burningtiger.com> Message-ID: <Pine.GSO.4.21.0112171404100.28340-100000@isis.visi.com> On Mon, 17 Dec 2001, Dethe Elza wrote: > The Python DOM Docs: > > http://www.python.org/doc/current/lib/module-xml.dom.html > > I tried to get to your example, but it required a login/password. Hi Dethe, Thanks for your willingness to look at my example. I've posted the bookmarks file (right-click to download) and a simple mock-up at http://www.isd197.org/sibley/staff/wilsont/xbel/ (Ignore the little breadcrumbs menus at the top of the page.) If I work on this some more, I'd probably add a little icon next to links to subfolders to distinguish them from hyperlinks to other Web sites. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | <dtml-var pithy_quote> | http://linux.com From dethe at burningtiger.com Mon Dec 17 15:45:39 2001 From: dethe at burningtiger.com (Dethe Elza) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Displaying bookmarks via XBEL References: <Pine.GSO.4.21.0112171404100.28340-100000@isis.visi.com> Message-ID: <3C1E5973.70603@burningtiger.com> Hi Tim, I'm going to be AWC (away from computer) for the rest of the day, so I won't be able to give you feedback until tonight or tomorrow, but wanted you to know the xbel file is still password-protected and I cannot access it. --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From wilson at visi.com Mon Dec 17 15:53:47 2001 From: wilson at visi.com (Timothy Wilson) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Displaying bookmarks via XBEL In-Reply-To: <3C1E5973.70603@burningtiger.com> Message-ID: <Pine.GSO.4.21.0112171453010.991-100000@isis.visi.com> On Mon, 17 Dec 2001, Dethe Elza wrote: > I'm going to be AWC (away from computer) for the rest of the day, so I > won't be able to give you feedback until tonight or tomorrow, but wanted > you to know the xbel file is still password-protected and I cannot > access it. Try right-clicking on the link and saving to a file that way. It worked for me. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | <dtml-var pithy_quote> | http://linux.com