|
From: Blake W. <bl...@ph...> - 2003-02-06 17:14:24
|
> >How are you poor at XML? Is it anything I can help with? > Writing proper XML, I'm poor at that, until now I can't > figure out how to write an XML file using DOM or SAX, you > know writing proper XML files like RSS 2.0 without using > regexp style escape, the most I got to do is a blosxom > style rss dump, and that is not writing proper XML. http://uche.ogbuji.net:8080/uche.ogbuji.net/tech/pubs/ might help. or http://www.xml.com/pub/a/2002/11/13/py-xml.html or http://xml.coverpages.org/xmlPython.html But yeah, it's a little tricky. I stick with the standard "print" statements, myself. They seem to get the job done. > Parsing XML, another story, looking at python's style of > xml parsing from the examples I saw, I can't get to > understand how it works, though I can modify code like > Mark Pilgrim's rssparser.py to get some data I need, but > when it comes to identicle tags like link in channels > and link in channels->author (or something like that) I > gave up :) If it was a SAX-based parser (which I imagine it is), then you'll need to keep the state yourself, and when you see the "channels->author" tag(s), set a flag. That's why I tend to use DOM-based parsers, such as: http://www-106.ibm.com/developerworks/xml/library/x-tipulldom.html I agree that XML parsing isn't the easiest thing to do, but it might be worth learning, and there are a lot of resources out there. > >>The advantage to using XML is that other non-Python > >>processes can manipulate the data. > That is the most compelling reason to use XML IMHO, hehe, > you can dump the data, then edit the file (provided you > keep to XML constraints like escapes and what nots) then > get the 'driver' to load the data back. > Cool, I like XML already :) Sold! ;) > Yeah, but isn't using XML as a native format for, say > referer data, slow? I've tried marshal.xml before to > store data, and it's painfully slow to load. There are ways to optimize it, I'm sure. > >more details on his comments system. > It's a standard movabletype dump, here's what it looks > like for my birthday entry in > http://roughingit.subtlehints.net/ : > -------- [snip...] > -------- Could you mail me a file containing the dump for an entry or two? It looks easy enough to parse from what I can see here, and if I could write something to convert it to XML, that might get us most of the way there. > mt2blosxom.py only works on the entries, but not the comments. For now... ;) > >Oh, yeah, while I'm here. > >I'm subscribed to pyblosxom-devel, pyblosxom-users, and > >even pyblosxom-checkins, so you don't need to copy me in > >on messages that are going to those addresses, since I'll > >get a copy of them if you just send them to the list. > Sorry 'bout that. No worries. It was more a request for the future. Oh, one final question, are we happy with the location and name of the storageApy.py file? Shall I check it in, given that we can always edit it further? And more responses: > >Really? I figured we would use the same API to handle > >both storageApi compliant objects and external systems, > The thing is, how do you get people to use the same data > format with differing comments system out there. You either write converters, or get other people to write converters, or get so popular that everyone else writes to your standard. I'm hoping for option 3, but would be happy with option 2, and would even go with option 1 without too much complaining. ;) > If you want something that works with all *osxoms, then > you need something standalone and outside of pyblosxom, > like what Rael did with the Standalone Trackback Tool, > or something like quicktopics on steroids :) The format shouldn't be pyblosom specific, but pyblosxom will handle it, and it will (apparently) be driven by the pyblosxom developers. We could write code for the standard blosxom to support it, and then all the other blosxom clones would be forced to add support for it to keep up. > We just need a well documented XML format then, agreed? Agreed. Are there any we can snarf on the weeb? (I've just done a search and found the following: http://www.diaries.com/digiboy/stories/storyReader$41 Handles threads, doesn't handle trackback/pingback. Later, Blake. |